diff options
author | Sam Lantinga <slouken@libsdl.org> | 2006-02-16 10:11:48 +0000 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2006-02-16 10:11:48 +0000 |
commit | d3805eef093e1cb8df5ff6cd1ccf085567b71a61 (patch) | |
tree | 41bbffab40ab8469441aa84821118c2b182a5bdc | |
parent | 150784622582a1200864e6e479a4423544f59a71 (diff) |
New configure-based build system. Still work in progress, but much improved
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401365
453 files changed, 3487 insertions, 6660 deletions
diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index d1aaddba..00000000 --- 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 0e95ee6d..d41693a1 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 <afb@algonet.se> @@ -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 afd60019..ab1ba5a0 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 <richard-alsa@tartarus.org> @@ -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. @@ -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 index 17690aea..17690aea 100755 --- a/config.guess +++ b/build-scripts/config.guess diff --git a/config.sub b/build-scripts/config.sub index a4e8a94a..a4e8a94a 100755 --- a/config.sub +++ b/build-scripts/config.sub diff --git a/build-scripts/install-sh b/build-scripts/install-sh new file mode 100755 index 00000000..1a835340 --- /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 index c5205b6b..c5205b6b 100644 --- a/ltmain.sh +++ b/build-scripts/ltmain.sh diff --git a/build-scripts/makedep.sh b/build-scripts/makedep.sh new file mode 100755 index 00000000..c8be8b14 --- /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 00000000..8ab885ec --- /dev/null +++ b/build-scripts/mkinstalldirs @@ -0,0 +1,99 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# 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 index 007c94fb..007c94fb 100755 --- a/strip_fPIC.sh +++ b/build-scripts/strip_fPIC.sh diff --git a/configure.in b/configure.in index 6cf890f9..afa0b5da 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) -fi -AC_FUNC_STRTOD -if test x$ac_cv_func_strtod = xyes; then - AC_DEFINE(HAVE_STRTOD) +# Set up the build preprocessor flags +INCLUDE="-I$srcdir/include" +if test x$srcdir != x.; then + INCLUDE="-Iinclude $INCLUDE" 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 <artsc.h> ],[ @@ -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 <altivec.h> + 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 <altivec.h> + 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 <Carbon/Carbon.h> + ],[ + ],[ + 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 <Cocoa/Cocoa.h> + ],[ + ],[ + 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 <sys/time.h> + #include <dev/wscons/wsconsio.h> + ],[ + ],[ + 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 +} - VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib" - VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la" +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 <qpe/qpeapplication.h> + ],[ + ],[ + 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 +} + +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 <picogui.h> + ],[ + ],[ + 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 <GL/gl.h> #include <GL/glx.h> - #include <dlfcn.h> /* 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 <features.h> - #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 + # Basic thread creation functions + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c" - AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h) - have_semun=no - AC_TRY_COMPILE([ - #include <sys/types.h> - #include <sys/sem.h> - ],[ - union semun t; - ],[ - have_semun=yes - ]) - AC_MSG_RESULT($have_semun) - if test x$have_semun = xyes; then - CFLAGS="$CFLAGS -DHAVE_SEMUN" - fi - - # 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 <signal.h> - ],[ - 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 <qpe/qpeapplication.h> - ],[ - ],[ - 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 <sys/time.h> - #include <dev/wscons/wsconsio.h> - ],[ - ],[ - 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.]) - 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 <picogui.h> - ],[ - ],[ - 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" + 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 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 <Carbon/Carbon.h> - ],[ - ],[ - 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 <Cocoa/Cocoa.h> - ],[ - ],[ - 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 <dlfcn.h> ],[ ],[ - 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 <sys/types.h> @@ -1943,87 +1815,36 @@ CheckUSBHID() #endif ],[ report_desc_t d; - hid_start_parse(d, 1, 1); + hid_start_parse(d, 1, 1); ],[ have_usbhid_new=yes ]) if test x$have_usbhid_new = xyes; then - CFLAGS="$CFLAGS -DUSBHID_NEW" + USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW" fi AC_MSG_RESULT($have_usbhid_new) - JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd" - JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la" + 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 + CFLAGS="$save_CFLAGS" fi } -dnl Check for altivec instruction support using gas syntax -CheckAltivec() +dnl Check for clock_gettime() +CheckClockGettime() { - 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 <altivec.h> - 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 <altivec.h> - 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" + 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 } @@ -2033,7 +1854,7 @@ 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" + BUILD_CFLAGS="$BUILD_CFLAGS -DHAVE_LINUX_VERSION_H" fi } @@ -2041,34 +1862,48 @@ dnl Check if we want to use RPATH CheckRPATH() { AC_ARG_ENABLE(rpath, -[ --enable-rpath use an rpath when linking SDL [default=yes]], +AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [default=yes]]), , enable_rpath=yes) } -have_loadso=no +dnl Set up the configuration based on the target platform! case "$target" in - arm-*-elf*) - ARCH=linux - CheckDummyVideo - CheckIPod - # Set up files for the timer library + 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 - ;; - *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu) + ;; + *-*-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 + *-*-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 + CheckDMEDIA CheckALSA CheckARTSC CheckESD @@ -2080,507 +1915,115 @@ case "$target" in CheckPS2GS CheckGGI CheckSVGA + CheckVGL + CheckWscons 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" - 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 - ;; - *-*-solaris*) - ARCH=solaris - CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86 - CheckDummyVideo - CheckDiskAudio - CheckDLOPEN - CheckNASM - CheckOSS - CheckARTSC - CheckESD - CheckNAS - CheckX11 - CheckAAlib - CheckOpenGLX11 CheckPTHREAD - CheckSIGACTION + CheckClockGettime + CheckLinuxVersion 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 - 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 - CheckGGI - CheckAAlib - CheckOpenGLX11 - CheckPTHREAD - CheckSIGACTION - # 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 00000000..1dd5d702 --- /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 <stdarg.h> +#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 a5ff395b..27ef6fde 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 <stdarg.h> #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 3871953f..26d6bfae 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 1e64c511..517f2fd6 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -55,14 +55,13 @@ char *alloca (); #else # if HAVE_STDLIB_H # include <stdlib.h> +# elif HAVE_MALLOC_H +# include <malloc.h> # endif # if HAVE_STDARG_H # include <stdarg.h> # endif #endif -#if HAVE_MALLOC_H -# include <malloc.h> -#endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 2f74735b..b3ff754a 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 <X11/Xlib.h> #include <X11/Xatom.h> @@ -105,7 +100,7 @@ typedef struct SDL_SysWMinfo { } info; } SDL_SysWMinfo; -#elif defined(ENABLE_NANOX) +#elif SDL_VIDEO_DRIVER_NANOX #include <microwin/nano-X.h> /* 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 <sys/neutrino.h> #include <Ph.h> @@ -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 132db863..b147490c 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 fe873297..00000000 --- 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 - @@ -22,26 +22,26 @@ /* Initialization code for SDL */ -#ifdef ENABLE_PTH -#include <pth.h> -#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 <pth.h> #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 c0cde54d..ea59aeb5 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 795f6c62..00000000 --- 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 e8a68069..00000000 --- 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 dc66eb39..3fa5b12d 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 03f3cfc5..00000000 --- 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 <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <stddef.h> -#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 ce73d806..a60e2c7d 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 32754e4c..b7e8377d 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 f76d78c6..b11759c0 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 4f30d158..00000000 --- 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 08c7abb7..fc091f57 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -27,18 +27,13 @@ #include <sys/types.h> #include <signal.h> /* 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 <dlfcn.h> #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 a0a5632c..cbe27dba 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 <alsa/asoundlib.h> +#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 99d95d8a..00000000 --- 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 0130e66c..a6b5a6ad 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 fd5c9bd9..c059086c 100644 --- a/src/audio/amigaos/SDL_ahiaudio.h +++ b/src/audio/amigaos/SDL_ahiaudio.h @@ -33,7 +33,8 @@ #include <devices/ahi.h> #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 e0d409ef..00000000 --- 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 68b14ae1..b4e95082 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 9e50f21b..114170f9 100644 --- a/src/audio/arts/SDL_artsaudio.h +++ b/src/audio/arts/SDL_artsaudio.h @@ -24,7 +24,8 @@ #define _SDL_artscaudio_h #include <artsc.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/baudio/Makefile.am b/src/audio/baudio/Makefile.am deleted file mode 100644 index a98d9d9e..00000000 --- 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 29ab97f4..9758bc8a 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 1506b67f..5a5e34c8 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 f1d3b3e4..00f58ae1 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 def9b8c5..27a7faa3 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 <os2.h> #include <os2me.h> // 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 a5d0e1cf..00000000 --- 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 41f5efd6..d6327f7f 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 58a9291d..b2d66a11 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 ab3310a8..00000000 --- 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 6b6af41b..cc5e9a32 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 4a1996bf..7a80bf29 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 fa4ce467..00000000 --- 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 6cdb7592..10d4547f 100644 --- a/src/audio/dma/SDL_dmaaudio.c +++ b/src/audio/dma/SDL_dmaaudio.c @@ -33,7 +33,10 @@ #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/mman.h> -#ifdef OSS_USE_SOUNDCARD_H + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H /* This is installed on some systems */ #include <soundcard.h> #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 3174a0e6..f48e7919 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 149385eb..00000000 --- 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 632ee98c..406a9375 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 7e1771ee..dd8df362 100644 --- a/src/audio/dmedia/SDL_irixaudio.h +++ b/src/audio/dmedia/SDL_irixaudio.h @@ -25,7 +25,7 @@ #include <dmedia/audio.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/dsp/Makefile.am b/src/audio/dsp/Makefile.am deleted file mode 100644 index bccca129..00000000 --- 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 dd424f54..6804f1c5 100644 --- a/src/audio/dsp/SDL_dspaudio.c +++ b/src/audio/dsp/SDL_dspaudio.c @@ -34,7 +34,10 @@ #include <sys/time.h> #include <sys/ioctl.h> #include <sys/stat.h> -#ifdef OSS_USE_SOUNDCARD_H + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H /* This is installed on some systems */ #include <soundcard.h> #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 cbb7f975..8d62993b 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 a9ac22e8..00000000 --- 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 3445d5b3..bd2d9863 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 82a3e214..cdfa0973 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 2b71efb8..00000000 --- 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 1f8e9bd8..425b4898 100644 --- a/src/audio/macosx/SDL_coreaudio.c +++ b/src/audio/macosx/SDL_coreaudio.c @@ -23,9 +23,8 @@ #include <AudioUnit/AudioUnit.h> #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 4da6f2e1..93080a1f 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 31ee995c..00000000 --- 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 d88f9f60..f9002e2a 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 38fe77e9..28296d8d 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 21d910d9..00000000 --- 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 3a0d320d..f679124f 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 f8379d64..2b9fea3a 100644 --- a/src/audio/mint/SDL_mintaudio_dma8.c +++ b/src/audio/mint/SDL_mintaudio_dma8.c @@ -33,9 +33,8 @@ #include <mint/cookie.h> #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 4719a5bc..5af835d1 100644 --- a/src/audio/mint/SDL_mintaudio_gsxb.c +++ b/src/audio/mint/SDL_mintaudio_gsxb.c @@ -33,9 +33,8 @@ #include <mint/cookie.h> #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 c3229ae3..99bcd2c3 100644 --- a/src/audio/mint/SDL_mintaudio_mcsn.c +++ b/src/audio/mint/SDL_mintaudio_mcsn.c @@ -35,9 +35,8 @@ #include <mint/cookie.h> #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 ab905edf..65a9e844 100644 --- a/src/audio/mint/SDL_mintaudio_stfa.c +++ b/src/audio/mint/SDL_mintaudio_stfa.c @@ -33,9 +33,8 @@ #include <mint/cookie.h> #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 1b96b43d..89c0afac 100644 --- a/src/audio/mint/SDL_mintaudio_xbios.c +++ b/src/audio/mint/SDL_mintaudio_xbios.c @@ -36,9 +36,8 @@ #include <mint/cookie.h> #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 b5ab2d6d..00000000 --- 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 f48b4435..77435905 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 36e99f59..f589dedb 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 abb6f131..00000000 --- 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 af4f5922..dd479a74 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 7278d5a5..658ade12 100644 --- a/src/audio/nas/SDL_nasaudio.h +++ b/src/audio/nas/SDL_nasaudio.h @@ -33,7 +33,8 @@ #include <audio/audiolib.h> #endif #include <sys/time.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/nto/Makefile.am b/src/audio/nto/Makefile.am deleted file mode 100644 index 3e77c5b7..00000000 --- a/src/audio/nto/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the QNX Neutrino PCM audio API - -noinst_LTLIBRARIES = libaudio_nto.la -libaudio_nto_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_nto_audio.c \ - SDL_nto_audio.h diff --git a/src/audio/nto/SDL_nto_audio.c b/src/audio/nto/SDL_nto_audio.c index fc9982fa..353cac4e 100644 --- a/src/audio/nto/SDL_nto_audio.c +++ b/src/audio/nto/SDL_nto_audio.c @@ -33,8 +33,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_nto_audio.h" /* The tag name used by NTO audio */ diff --git a/src/audio/nto/SDL_nto_audio.h b/src/audio/nto/SDL_nto_audio.h index fcfaf791..967a9372 100644 --- a/src/audio/nto/SDL_nto_audio.h +++ b/src/audio/nto/SDL_nto_audio.h @@ -23,9 +23,10 @@ #ifndef __SDL_NTO_AUDIO_H__ #define __SDL_NTO_AUDIO_H__ -#include "SDL_sysaudio.h" #include <sys/asoundlib.h> +#include "../SDL_sysaudio.h" + /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/openbsd/Makefile.am b/src/audio/openbsd/Makefile.am deleted file mode 100644 index a63b6ecd..00000000 --- a/src/audio/openbsd/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the native OpenBSD sound driver - -noinst_LTLIBRARIES = libaudio_openbsd.la -libaudio_openbsd_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_openbsdaudio.c \ - SDL_openbsdaudio.h diff --git a/src/audio/openbsd/SDL_openbsdaudio.c b/src/audio/openbsd/SDL_openbsdaudio.c index 08cfaf17..1e036b5d 100644 --- a/src/audio/openbsd/SDL_openbsdaudio.c +++ b/src/audio/openbsd/SDL_openbsdaudio.c @@ -36,9 +36,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_openbsdaudio.h" /* The tag name used by OpenBSD audio */ diff --git a/src/audio/openbsd/SDL_openbsdaudio.h b/src/audio/openbsd/SDL_openbsdaudio.h index e7e71cdc..7b3fd1d4 100644 --- a/src/audio/openbsd/SDL_openbsdaudio.h +++ b/src/audio/openbsd/SDL_openbsdaudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_openbsdaudio_h #define _SDL_openbsdaudio_h -#include "SDL_sysaudio.h" +#include "../SDL_sysaudio.h" #define _THIS SDL_AudioDevice *this diff --git a/src/audio/paudio/Makefile.am b/src/audio/paudio/Makefile.am deleted file mode 100644 index be06160c..00000000 --- a/src/audio/paudio/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the AIX PAudio sound driver - -noinst_LTLIBRARIES = libaudio_paudio.la -libaudio_paudio_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_paudio.c \ - SDL_paudio.h diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index ca261c8b..d880908e 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -33,9 +33,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_paudio.h" #define DEBUG_AUDIO 1 diff --git a/src/audio/paudio/SDL_paudio.h b/src/audio/paudio/SDL_paudio.h index 55f1ed63..f5fa3434 100644 --- a/src/audio/paudio/SDL_paudio.h +++ b/src/audio/paudio/SDL_paudio.h @@ -23,7 +23,7 @@ #ifndef _SDL_paudaudio_h #define _SDL_paudaudio_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/sun/Makefile.am b/src/audio/sun/Makefile.am deleted file mode 100644 index 4321ce0f..00000000 --- a/src/audio/sun/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the UNIX /dev/audio sound driver - -noinst_LTLIBRARIES = libaudio_sun.la -libaudio_sun_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_sunaudio.c \ - SDL_sunaudio.h diff --git a/src/audio/sun/SDL_sunaudio.c b/src/audio/sun/SDL_sunaudio.c index e6b961c4..f20bca40 100644 --- a/src/audio/sun/SDL_sunaudio.c +++ b/src/audio/sun/SDL_sunaudio.c @@ -38,10 +38,10 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audiomem.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_sunaudio.h" -#include "SDL_audio_c.h" /* Open the audio device for playback, and don't block if busy */ #define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) diff --git a/src/audio/sun/SDL_sunaudio.h b/src/audio/sun/SDL_sunaudio.h index 55317e38..0a174b9c 100644 --- a/src/audio/sun/SDL_sunaudio.h +++ b/src/audio/sun/SDL_sunaudio.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/ums/Makefile.am b/src/audio/ums/Makefile.am deleted file mode 100644 index 479e1ea2..00000000 --- a/src/audio/ums/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the AIX UMS sound driver - -noinst_LTLIBRARIES = libaudio_ums.la -libaudio_ums_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_umsaudio.c \ - SDL_umsaudio.h diff --git a/src/audio/ums/SDL_umsaudio.c b/src/audio/ums/SDL_umsaudio.c index ba88633f..d31684f8 100644 --- a/src/audio/ums/SDL_umsaudio.c +++ b/src/audio/ums/SDL_umsaudio.c @@ -34,8 +34,8 @@ #include <sys/mman.h> #include "SDL_audio.h" -#include "SDL_audio_c.h" -#include "SDL_audiodev_c.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" #include "SDL_umsaudio.h" /* The tag name used by UMS audio */ diff --git a/src/audio/ums/SDL_umsaudio.h b/src/audio/ums/SDL_umsaudio.h index 298bcf75..c3ceb516 100644 --- a/src/audio/ums/SDL_umsaudio.h +++ b/src/audio/ums/SDL_umsaudio.h @@ -25,10 +25,10 @@ #ifndef _SDL_UMSaudio_h #define _SDL_UMSaudio_h -#include "SDL_sysaudio.h" - #include <UMS/UMSAudioDevice.h> +#include "../SDL_sysaudio.h" + /* Hidden "this" pointer for the video functions */ #define _THIS SDL_AudioDevice *this diff --git a/src/audio/windib/Makefile.am b/src/audio/windib/Makefile.am deleted file mode 100644 index f29e2477..00000000 --- a/src/audio/windib/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -## Makefile.am for SDL using the Win32 WaveOut audio driver - -noinst_LTLIBRARIES = libaudio_windib.la -libaudio_windib_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_dibaudio.c \ - SDL_dibaudio.h diff --git a/src/audio/windib/SDL_dibaudio.c b/src/audio/windib/SDL_dibaudio.c index 4f3acc93..2777f686 100644 --- a/src/audio/windib/SDL_dibaudio.c +++ b/src/audio/windib/SDL_dibaudio.c @@ -27,7 +27,7 @@ #include "SDL_timer.h" #include "SDL_audio.h" -#include "SDL_audio_c.h" +#include "../SDL_audio_c.h" #include "SDL_dibaudio.h" #if defined(_WIN32_WCE) && (_WIN32_WCE < 300) #include "win_ce_semaphore.h" diff --git a/src/audio/windib/SDL_dibaudio.h b/src/audio/windib/SDL_dibaudio.h index ed1de51f..3474f254 100644 --- a/src/audio/windib/SDL_dibaudio.h +++ b/src/audio/windib/SDL_dibaudio.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/windx5/Makefile.am b/src/audio/windx5/Makefile.am deleted file mode 100644 index 5e8e5569..00000000 --- a/src/audio/windx5/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -## Makefile.am for SDL using the Win32 DirectX audio driver - -noinst_LTLIBRARIES = libaudio_windx5.la -libaudio_windx5_la_SOURCES = $(SRCS) - -# The SDL audio driver sources -SRCS = SDL_dx5audio.c \ - SDL_dx5audio.h \ - directx.h diff --git a/src/audio/windx5/SDL_dx5audio.c b/src/audio/windx5/SDL_dx5audio.c index 2a64a769..1256fbf6 100644 --- a/src/audio/windx5/SDL_dx5audio.c +++ b/src/audio/windx5/SDL_dx5audio.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_dx5audio.h" /* Define this if you want to use DirectX 6 DirectSoundNotify interface */ diff --git a/src/audio/windx5/SDL_dx5audio.h b/src/audio/windx5/SDL_dx5audio.h index 51020702..691c1a69 100644 --- a/src/audio/windx5/SDL_dx5audio.h +++ b/src/audio/windx5/SDL_dx5audio.h @@ -25,7 +25,7 @@ #include "directx.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/cdrom/Makefile.am b/src/cdrom/Makefile.am deleted file mode 100644 index cbb2df1c..00000000 --- a/src/cdrom/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ - -## Makefile.am for the SDL cdrom library - -noinst_LTLIBRARIES = libcdrom.la - -# Define which subdirectories need to be built -SUBDIRS = @CDROM_SUBDIRS@ -DIST_SUBDIRS = \ - aix \ - beos \ - bsdi \ - dc \ - dummy \ - freebsd \ - linux \ - macos \ - macosx \ - mint \ - openbsd \ - osf \ - qnx \ - win32 - -DRIVERS = @CDROM_DRIVERS@ - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_cdrom.c \ - SDL_syscdrom.h - -libcdrom_la_SOURCES = $(COMMON_SRCS) -libcdrom_la_LIBADD = $(DRIVERS) -libcdrom_la_DEPENDENCIES = $(DRIVERS) diff --git a/src/cdrom/aix/Makefile.am b/src/cdrom/aix/Makefile.am deleted file mode 100644 index 2a40b914..00000000 --- a/src/cdrom/aix/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the AIX cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_aix.la -libcdrom_aix_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/aix/SDL_syscdrom.c b/src/cdrom/aix/SDL_syscdrom.c index c7799241..49dafffc 100644 --- a/src/cdrom/aix/SDL_syscdrom.c +++ b/src/cdrom/aix/SDL_syscdrom.c @@ -24,7 +24,7 @@ /* Functions for system-level CD-ROM audio control */ -#define DEBUG_CDROM 1 +/*#define DEBUG_CDROM 1*/ #include <sys/types.h> #include <sys/stat.h> @@ -41,7 +41,7 @@ #include <sys/scdisk.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ #define MAX_DRIVES 16 diff --git a/src/cdrom/beos/Makefile.am b/src/cdrom/beos/Makefile.am deleted file mode 100644 index a3a4bf03..00000000 --- a/src/cdrom/beos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the BeOS cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_beos.la -libcdrom_beos_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.cc diff --git a/src/cdrom/beos/SDL_syscdrom.cc b/src/cdrom/beos/SDL_syscdrom.cc index da97d031..1f309a0a 100644 --- a/src/cdrom/beos/SDL_syscdrom.cc +++ b/src/cdrom/beos/SDL_syscdrom.cc @@ -35,7 +35,7 @@ #include "SDL_cdrom.h" extern "C" { -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" } /* Constants to help us get at the SCSI table-of-contents info */ diff --git a/src/cdrom/bsdi/Makefile.am b/src/cdrom/bsdi/Makefile.am deleted file mode 100644 index 57f4032b..00000000 --- a/src/cdrom/bsdi/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the BSDi cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_bsdi.la -libcdrom_bsdi_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/bsdi/SDL_syscdrom.c b/src/cdrom/bsdi/SDL_syscdrom.c index 5a466e00..0eb35e7d 100644 --- a/src/cdrom/bsdi/SDL_syscdrom.c +++ b/src/cdrom/bsdi/SDL_syscdrom.c @@ -38,7 +38,7 @@ #include </sys/dev/scsi/scsi_ioctl.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* * The msf_to_frame and frame_to_msf were yanked from libcdrom and inlined diff --git a/src/cdrom/dc/Makefile.am b/src/cdrom/dc/Makefile.am deleted file mode 100644 index 7bf356ee..00000000 --- a/src/cdrom/dc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Dreamcast cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_dc.la -libcdrom_dc_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/dc/SDL_syscdrom.c b/src/cdrom/dc/SDL_syscdrom.c index 8b56cd89..eb1c6a27 100644 --- a/src/cdrom/dc/SDL_syscdrom.c +++ b/src/cdrom/dc/SDL_syscdrom.c @@ -26,7 +26,7 @@ #include <dc/spu.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The system-dependent CD control functions */ static const char *SDL_SYS_CDName(int drive); diff --git a/src/cdrom/dummy/Makefile.am b/src/cdrom/dummy/Makefile.am deleted file mode 100644 index f726a6e9..00000000 --- a/src/cdrom/dummy/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the dummy cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_dummy.la -libcdrom_dummy_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/dummy/SDL_syscdrom.c b/src/cdrom/dummy/SDL_syscdrom.c index b87647a8..c8b7380f 100644 --- a/src/cdrom/dummy/SDL_syscdrom.c +++ b/src/cdrom/dummy/SDL_syscdrom.c @@ -23,7 +23,7 @@ /* Stub functions for system-level CD-ROM audio control */ #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" int SDL_SYS_CDInit(void) { diff --git a/src/cdrom/freebsd/Makefile.am b/src/cdrom/freebsd/Makefile.am deleted file mode 100644 index c54459fa..00000000 --- a/src/cdrom/freebsd/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the FreeBSD cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_freebsd.la -libcdrom_freebsd_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/freebsd/SDL_syscdrom.c b/src/cdrom/freebsd/SDL_syscdrom.c index b54d643b..b6cde3fc 100644 --- a/src/cdrom/freebsd/SDL_syscdrom.c +++ b/src/cdrom/freebsd/SDL_syscdrom.c @@ -30,7 +30,7 @@ #include <sys/cdio.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ diff --git a/src/cdrom/linux/Makefile.am b/src/cdrom/linux/Makefile.am deleted file mode 100644 index 17d10ef3..00000000 --- a/src/cdrom/linux/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Linux cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_linux.la -libcdrom_linux_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/linux/SDL_syscdrom.c b/src/cdrom/linux/SDL_syscdrom.c index e035f7f2..d00f40d8 100644 --- a/src/cdrom/linux/SDL_syscdrom.c +++ b/src/cdrom/linux/SDL_syscdrom.c @@ -82,7 +82,7 @@ #endif /* USE_MNTENT */ #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ diff --git a/src/cdrom/macos/Makefile.am b/src/cdrom/macos/Makefile.am deleted file mode 100644 index abd1dd78..00000000 --- a/src/cdrom/macos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the MacOS Classic cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_macos.la -libcdrom_macos_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c SDL_syscdrom_c.h diff --git a/src/cdrom/macos/SDL_syscdrom.c b/src/cdrom/macos/SDL_syscdrom.c index 36626e38..668535ea 100644 --- a/src/cdrom/macos/SDL_syscdrom.c +++ b/src/cdrom/macos/SDL_syscdrom.c @@ -27,7 +27,7 @@ #include <LowMem.h> /* Use entry table macros, not functions in InterfaceLib */ #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" #include "SDL_syscdrom_c.h" /* Added by Matt Slot */ diff --git a/src/cdrom/macosx/Makefile.am b/src/cdrom/macosx/Makefile.am deleted file mode 100644 index 062c2d19..00000000 --- a/src/cdrom/macosx/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -## Makefile.am for the Mac OS X cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_macosx.la -libcdrom_macosx_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = \ - SDL_syscdrom_c.h \ - SDL_syscdrom.c \ - AudioFilePlayer.h \ - AudioFilePlayer.c \ - AudioFileReaderThread.c \ - SDLOSXCAGuard.c \ - CDPlayer.h \ - CDPlayer.c diff --git a/src/cdrom/macosx/SDL_syscdrom_c.h b/src/cdrom/macosx/SDL_syscdrom_c.h index b0ed7d44..7c2e390d 100644 --- a/src/cdrom/macosx/SDL_syscdrom_c.h +++ b/src/cdrom/macosx/SDL_syscdrom_c.h @@ -127,7 +127,7 @@ #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" #include "CDPlayer.h" diff --git a/src/cdrom/mint/Makefile.am b/src/cdrom/mint/Makefile.am deleted file mode 100644 index 362af6ac..00000000 --- a/src/cdrom/mint/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the MiNT+MetaDOS cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_mint.la -libcdrom_mint_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/mint/SDL_syscdrom.c b/src/cdrom/mint/SDL_syscdrom.c index 9d779110..a176caea 100644 --- a/src/cdrom/mint/SDL_syscdrom.c +++ b/src/cdrom/mint/SDL_syscdrom.c @@ -32,7 +32,7 @@ #include <metados.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* Some ioctl() errno values which occur when the tray is empty */ #ifndef ENOMEDIUM diff --git a/src/cdrom/openbsd/Makefile.am b/src/cdrom/openbsd/Makefile.am deleted file mode 100644 index 12ca102b..00000000 --- a/src/cdrom/openbsd/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the OpenBSD cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_openbsd.la -libcdrom_openbsd_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/openbsd/SDL_syscdrom.c b/src/cdrom/openbsd/SDL_syscdrom.c index 3d66b46e..21353283 100644 --- a/src/cdrom/openbsd/SDL_syscdrom.c +++ b/src/cdrom/openbsd/SDL_syscdrom.c @@ -32,7 +32,7 @@ #include <sys/cdio.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ diff --git a/src/cdrom/os2/SDL_syscdrom.c b/src/cdrom/os2/SDL_syscdrom.c index bb83ebbc..900381af 100644 --- a/src/cdrom/os2/SDL_syscdrom.c +++ b/src/cdrom/os2/SDL_syscdrom.c @@ -27,7 +27,7 @@ #include <os2me.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* Size of MCI result buffer (in bytes) */ #define MCI_CMDRETBUFSIZE 128 diff --git a/src/cdrom/osf/Makefile.am b/src/cdrom/osf/Makefile.am deleted file mode 100644 index 2cf49f47..00000000 --- a/src/cdrom/osf/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the osf cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_osf.la -libcdrom_osf_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/osf/SDL_syscdrom.c b/src/cdrom/osf/SDL_syscdrom.c index ddd46b56..f4a92f92 100644 --- a/src/cdrom/osf/SDL_syscdrom.c +++ b/src/cdrom/osf/SDL_syscdrom.c @@ -33,7 +33,7 @@ #include <io/common/devgetinfo.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ #define MAX_DRIVES 16 diff --git a/src/cdrom/qnx/Makefile.am b/src/cdrom/qnx/Makefile.am deleted file mode 100644 index 79d35283..00000000 --- a/src/cdrom/qnx/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the QNX cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_qnx.la -libcdrom_qnx_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/qnx/SDL_syscdrom.c b/src/cdrom/qnx/SDL_syscdrom.c index 065cc7ea..1a5d5210 100644 --- a/src/cdrom/qnx/SDL_syscdrom.c +++ b/src/cdrom/qnx/SDL_syscdrom.c @@ -33,7 +33,7 @@ #include "SDL_timer.h" #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ #define MAX_DRIVES 16 diff --git a/src/cdrom/win32/Makefile.am b/src/cdrom/win32/Makefile.am deleted file mode 100644 index 00c8806f..00000000 --- a/src/cdrom/win32/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Windows cdrom driver for SDL - -noinst_LTLIBRARIES = libcdrom_win32.la -libcdrom_win32_la_SOURCES = $(SRCS) - -# The SDL cdrom driver sources -SRCS = SDL_syscdrom.c diff --git a/src/cdrom/win32/SDL_syscdrom.c b/src/cdrom/win32/SDL_syscdrom.c index 283d32d4..6c1ea220 100644 --- a/src/cdrom/win32/SDL_syscdrom.c +++ b/src/cdrom/win32/SDL_syscdrom.c @@ -26,7 +26,7 @@ #include <mmsystem.h> #include "SDL_cdrom.h" -#include "SDL_syscdrom.h" +#include "../SDL_syscdrom.h" /* This really broken?? */ #define BROKEN_MCI_PAUSE /* Pausing actually stops play -- Doh! */ diff --git a/src/cpuinfo/Makefile.am b/src/cpuinfo/Makefile.am deleted file mode 100644 index a5f62f12..00000000 --- a/src/cpuinfo/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -# The cpuinfo library target -noinst_LTLIBRARIES = libcpuinfo.la - -COMMON_SRCS = \ - SDL_cpuinfo.c - -libcpuinfo_la_SOURCES = $(COMMON_SRCS) diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 215b4f62..5d16dbd5 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -22,16 +22,15 @@ /* CPU feature detection for SDL */ -#ifdef unix /* FIXME: Better setjmp detection? */ -#define USE_SETJMP +#include "SDL.h" +#include "SDL_cpuinfo.h" + +#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP #include <signal.h> #include <setjmp.h> #endif -#include "SDL.h" -#include "SDL_cpuinfo.h" - -#ifdef MACOSX +#if MACOSX #include <sys/sysctl.h> /* For AltiVec check */ #endif @@ -44,7 +43,7 @@ #define CPU_HAS_SSE2 0x00000080 #define CPU_HAS_ALTIVEC 0x00000100 -#if defined(USE_SETJMP) && defined(GCC_ALTIVEC) +#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP /* This is the brute force way of detecting instruction sets... the idea is borrowed from the libmpeg2 library - thanks! */ @@ -53,7 +52,7 @@ static void illegal_instruction(int sig) { longjmp(jmpbuf, 1); } -#endif // USE_SETJMP +#endif /* HAVE_SETJMP */ static __inline__ int CPU_haveCPUID() { @@ -112,18 +111,18 @@ CPUid by definition. But it's nice to be able to prove it. :) */ done: } #elif defined(__sun) && defined(__x86) - __asm ( + __asm ( " pushfl \n" -" popl %eax \n" -" movl %eax,%ecx \n" -" xorl $0x200000,%eax \n" -" pushl %eax \n" -" popfl \n" -" pushfl \n" -" popl %eax \n" -" xorl %ecx,%eax \n" -" jz 1f \n" -" movl $1,-8(%ebp) \n" +" popl %eax \n" +" movl %eax,%ecx \n" +" xorl $0x200000,%eax \n" +" pushl %eax \n" +" popfl \n" +" pushfl \n" +" popl %eax \n" +" xorl %ecx,%eax \n" +" jz 1f \n" +" movl $1,-8(%ebp) \n" "1: \n" ); #elif defined(__sun) && defined(__amd64) @@ -308,14 +307,14 @@ static __inline__ int CPU_haveSSE2() static __inline__ int CPU_haveAltiVec() { volatile int altivec = 0; -#ifdef MACOSX +#if MACOSX int selectors[2] = { CTL_HW, HW_VECTORUNIT }; int hasVectorUnit = 0; size_t length = sizeof(hasVectorUnit); int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); if( 0 == error ) altivec = (hasVectorUnit != 0); -#elif defined(USE_SETJMP) && defined(GCC_ALTIVEC) +#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP void (*handler)(int sig); handler = signal(SIGILL, illegal_instruction); if ( setjmp(jmpbuf) == 0 ) { diff --git a/src/events/Makefile.am b/src/events/Makefile.am deleted file mode 100644 index b8f65ffa..00000000 --- a/src/events/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ - -## Makefile.am for the SDL event handling library - -noinst_LTLIBRARIES = libevents.la - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_events.c \ - SDL_events_c.h \ - SDL_expose.c \ - SDL_sysevents.h \ - SDL_quit.c \ - SDL_active.c \ - SDL_keyboard.c \ - SDL_mouse.c \ - SDL_resize.c - -libevents_la_SOURCES = $(COMMON_SRCS) - diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index bce9d419..807fc830 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -23,16 +23,13 @@ /* General event handling code for SDL */ #include "SDL.h" -#include "SDL_events_c.h" -#include "SDL_timer_c.h" -#ifndef DISABLE_JOYSTICK -#include "SDL_joystick_c.h" -#endif -#ifndef ENABLE_X11 -#define DISABLE_X11 -#endif #include "SDL_syswm.h" #include "SDL_sysevents.h" +#include "SDL_events_c.h" +#include "../timer/SDL_timer_c.h" +#if !SDL_JOYSTICK_DISABLED +#include "../joystick/SDL_joystick_c.h" +#endif /* Public data -- the event filter */ SDL_EventFilter SDL_EventOK = NULL; @@ -112,7 +109,7 @@ static int SDL_GobbleEvents(void *unused) /* Queue pending key-repeat events */ SDL_CheckKeyRepeat(); -#ifndef DISABLE_JOYSTICK +#if !SDL_JOYSTICK_DISABLED /* Check for joystick state change */ if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { SDL_JoystickUpdate(); @@ -150,16 +147,16 @@ static int SDL_StartEventThread(Uint32 flags) SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock)); /* Create the lock and set ourselves active */ -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED SDL_EventQ.lock = SDL_CreateMutex(); if ( SDL_EventQ.lock == NULL ) { -#ifdef macintosh /* On MacOS 7/8, you can't multithread, so no lock needed */ +#ifdef macintosh /* MacOS classic you can't multithread, so no lock needed */ ; #else return(-1); #endif } -#endif /* !DISABLE_THREADS */ +#endif /* !SDL_THREADS_DISABLED */ SDL_EventQ.active = 1; if ( (flags&SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) { @@ -379,7 +376,7 @@ void SDL_PumpEvents(void) /* Queue pending key-repeat events */ SDL_CheckKeyRepeat(); -#ifndef DISABLE_JOYSTICK +#if !SDL_JOYSTICK_DISABLED /* Check for joystick state change */ if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { SDL_JoystickUpdate(); diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 562a41a2..ac0750e3 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -24,8 +24,8 @@ #include "SDL_events.h" #include "SDL_events_c.h" -#include "SDL_cursor_c.h" -#include "SDL_sysvideo.h" +#include "../video/SDL_cursor_c.h" +#include "../video/SDL_sysvideo.h" /* These are static for our mouse handling code */ diff --git a/src/events/SDL_resize.c b/src/events/SDL_resize.c index ac55f885..42d25b53 100644 --- a/src/events/SDL_resize.c +++ b/src/events/SDL_resize.c @@ -24,7 +24,7 @@ #include "SDL_events.h" #include "SDL_events_c.h" -#include "SDL_sysvideo.h" +#include "../video/SDL_sysvideo.h" /* Keep the last resize event so we don't post duplicates */ diff --git a/src/events/SDL_sysevents.h b/src/events/SDL_sysevents.h index 4cc4deed..3d1ce9c4 100644 --- a/src/events/SDL_sysevents.h +++ b/src/events/SDL_sysevents.h @@ -20,7 +20,7 @@ slouken@libsdl.org */ -#include "SDL_sysvideo.h" +#include "../video/SDL_sysvideo.h" /* Useful functions and variables from SDL_sysevents.c */ diff --git a/src/file/Makefile.am b/src/file/Makefile.am deleted file mode 100644 index de821713..00000000 --- a/src/file/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for the SDL file library - -noinst_LTLIBRARIES = libfile.la - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_rwops.c - -libfile_la_SOURCES = $(COMMON_SRCS) - diff --git a/src/hermes/Makefile.am b/src/hermes/Makefile.am deleted file mode 100644 index 78c11d50..00000000 --- a/src/hermes/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -########################################################################### -# -# Some consistent rules for building asm files: - -STRIP_FPIC = sh $(top_srcdir)/strip_fPIC.sh - -SUFFIXES = .asm - -.asm.lo: - $(LIBTOOL) --tag=CC --mode=compile $(STRIP_FPIC) $(NASM) @NASMFLAGS@ $< -o $*.o - -########################################################################### - -# The hermes library target -noinst_LTLIBRARIES = libhermes.la - -libhermes_la_SOURCES = $(PORTABLE_SRCS) -am_libhermes_la_OBJECTS = \ - mmx_main.lo \ - mmxp2_32.lo \ - x86_main.lo \ - x86p_16.lo \ - x86p_32.lo - -# The hermes library sources -PORTABLE_SRCS = \ - mmx_main.asm \ - mmxp2_32.asm \ - x86_main.asm \ - x86p_16.asm \ - x86p_32.asm \ - \ - HeadMMX.h \ - HeadX86.h - -EXTRA_DIST = \ - COPYING.LIB \ - README - diff --git a/src/joystick/Makefile.am b/src/joystick/Makefile.am deleted file mode 100644 index fa901514..00000000 --- a/src/joystick/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -## Makefile.am for the SDL joystick library - -noinst_LTLIBRARIES = libjoystick.la - -# Define which subdirectories need to be built -SUBDIRS = @JOYSTICK_SUBDIRS@ -DIST_SUBDIRS = dummy amigaos beos bsd darwin dc linux macos mint riscos win32 - -DRIVERS = @JOYSTICK_DRIVERS@ - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_joystick.c \ - SDL_joystick_c.h \ - SDL_sysjoystick.h - -libjoystick_la_SOURCES = $(COMMON_SRCS) -libjoystick_la_LIBADD = $(DRIVERS) -libjoystick_la_DEPENDENCIES = $(DRIVERS) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 6655a5a1..aed1e162 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -23,14 +23,14 @@ /* This is the joystick API for Simple DirectMedia Layer */ #include "SDL_events.h" -#ifndef DISABLE_EVENTS -#include "SDL_events_c.h" -#endif -#include "SDL_joystick_c.h" #include "SDL_sysjoystick.h" +#include "SDL_joystick_c.h" +#if !SDL_EVENTS_DISABLED +#include "../events/SDL_events_c.h" +#endif /* This is used for Quake III Arena */ -#ifdef DISABLE_EVENTS +#if SDL_EVENTS_DISABLED #define SDL_Lock_EventThread() #define SDL_Unlock_EventThread() #endif @@ -424,7 +424,7 @@ int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) /* Post the event, if desired */ posted = 0; -#ifndef DISABLE_EVENTS +#if !SDL_EVENTS_DISABLED if ( SDL_ProcessEvents[SDL_JOYAXISMOTION] == SDL_ENABLE ) { SDL_Event event; event.type = SDL_JOYAXISMOTION; @@ -436,7 +436,7 @@ int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) SDL_PushEvent(&event); } } -#endif /* !DISABLE_EVENTS */ +#endif /* !SDL_EVENTS_DISABLED */ return(posted); } @@ -449,7 +449,7 @@ int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) /* Post the event, if desired */ posted = 0; -#ifndef DISABLE_EVENTS +#if !SDL_EVENTS_DISABLED if ( SDL_ProcessEvents[SDL_JOYHATMOTION] == SDL_ENABLE ) { SDL_Event event; event.jhat.type = SDL_JOYHATMOTION; @@ -461,7 +461,7 @@ int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) SDL_PushEvent(&event); } } -#endif /* !DISABLE_EVENTS */ +#endif /* !SDL_EVENTS_DISABLED */ return(posted); } @@ -476,7 +476,7 @@ int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, /* Post the event, if desired */ posted = 0; -#ifndef DISABLE_EVENTS +#if !SDL_EVENTS_DISABLED if ( SDL_ProcessEvents[SDL_JOYBALLMOTION] == SDL_ENABLE ) { SDL_Event event; event.jball.type = SDL_JOYBALLMOTION; @@ -489,14 +489,14 @@ int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, SDL_PushEvent(&event); } } -#endif /* !DISABLE_EVENTS */ +#endif /* !SDL_EVENTS_DISABLED */ return(posted); } int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) { int posted; -#ifndef DISABLE_EVENTS +#if !SDL_EVENTS_DISABLED SDL_Event event; switch ( state ) { @@ -510,14 +510,14 @@ int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) /* Invalid state -- bail */ return(0); } -#endif /* !DISABLE_EVENTS */ +#endif /* !SDL_EVENTS_DISABLED */ /* Update internal joystick state */ joystick->buttons[button] = state; /* Post the event, if desired */ posted = 0; -#ifndef DISABLE_EVENTS +#if !SDL_EVENTS_DISABLED if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { event.jbutton.which = joystick->index; event.jbutton.button = button; @@ -527,7 +527,7 @@ int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) SDL_PushEvent(&event); } } -#endif /* !DISABLE_EVENTS */ +#endif /* !SDL_EVENTS_DISABLED */ return(posted); } @@ -542,7 +542,7 @@ void SDL_JoystickUpdate(void) int SDL_JoystickEventState(int state) { -#ifdef DISABLE_EVENTS +#if SDL_EVENTS_DISABLED return SDL_IGNORE; #else const Uint8 event_list[] = { @@ -568,5 +568,5 @@ int SDL_JoystickEventState(int state) break; } return(state); -#endif /* DISABLE_EVENTS */ +#endif /* SDL_EVENTS_DISABLED */ } diff --git a/src/joystick/amigaos/Makefile.am b/src/joystick/amigaos/Makefile.am deleted file mode 100644 index e9e54540..00000000 --- a/src/joystick/amigaos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the AmigaOS joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_amiga.la -libjoystick_amiga_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/amigaos/SDL_sysjoystick.c b/src/joystick/amigaos/SDL_sysjoystick.c index 7e06480d..ae0d767e 100644 --- a/src/joystick/amigaos/SDL_sysjoystick.c +++ b/src/joystick/amigaos/SDL_sysjoystick.c @@ -39,8 +39,8 @@ extern struct ExecBase *SysBase; extern struct GfxBase *GfxBase; #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" /* Function to scan the system for joysticks. * This function should set SDL_numjoysticks to the number of available diff --git a/src/joystick/beos/Makefile.am b/src/joystick/beos/Makefile.am deleted file mode 100644 index 010372cd..00000000 --- a/src/joystick/beos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the BeOS joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_beos.la -libjoystick_beos_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_bejoystick.cc diff --git a/src/joystick/beos/SDL_bejoystick.cc b/src/joystick/beos/SDL_bejoystick.cc index e0be88d8..fde707f0 100644 --- a/src/joystick/beos/SDL_bejoystick.cc +++ b/src/joystick/beos/SDL_bejoystick.cc @@ -28,8 +28,8 @@ extern "C" { #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" /* The maximum number of joysticks we'll detect */ diff --git a/src/joystick/bsd/Makefile.am b/src/joystick/bsd/Makefile.am deleted file mode 100644 index 5d2ce160..00000000 --- a/src/joystick/bsd/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the BSD joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_bsd.la -libjoystick_bsd_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/bsd/SDL_sysjoystick.c b/src/joystick/bsd/SDL_sysjoystick.c index 8681611b..2116defc 100644 --- a/src/joystick/bsd/SDL_sysjoystick.c +++ b/src/joystick/bsd/SDL_sysjoystick.c @@ -57,8 +57,8 @@ #endif #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" #define MAX_UHID_JOYS 4 #define MAX_JOY_JOYS 2 diff --git a/src/joystick/darwin/Makefile.am b/src/joystick/darwin/Makefile.am deleted file mode 100644 index 97b646e8..00000000 --- a/src/joystick/darwin/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -## Makefile.am for the darwin/MacOS X joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_darwin.la -libjoystick_darwin_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c - -AM_CPPFLAGS = -no-cpp-precomp -I/System/Library/Frameworks/Kernel.framework/Headers/ diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index 0673121b..a41de156 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c @@ -42,8 +42,8 @@ #include <Carbon/Carbon.h> /* for NewPtrClear, DisposePtr */ #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" struct recElement { diff --git a/src/joystick/dc/Makefile.am b/src/joystick/dc/Makefile.am deleted file mode 100644 index da51e95c..00000000 --- a/src/joystick/dc/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Dreamcast joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_dc.la -libjoystick_dc_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/dc/SDL_sysjoystick.c b/src/joystick/dc/SDL_sysjoystick.c index 0e9511da..6c739fef 100644 --- a/src/joystick/dc/SDL_sysjoystick.c +++ b/src/joystick/dc/SDL_sysjoystick.c @@ -23,8 +23,8 @@ /* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" #include <dc/maple.h> #include <dc/maple/controller.h> diff --git a/src/joystick/dummy/Makefile.am b/src/joystick/dummy/Makefile.am deleted file mode 100644 index 76593486..00000000 --- a/src/joystick/dummy/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the dummy joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_dummy.la -libjoystick_dummy_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c index 5a7003d8..953bd0ce 100644 --- a/src/joystick/dummy/SDL_sysjoystick.c +++ b/src/joystick/dummy/SDL_sysjoystick.c @@ -23,8 +23,8 @@ /* This is the system specific header for the SDL joystick API */ #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" /* Function to scan the system for joysticks. * This function should set SDL_numjoysticks to the number of available diff --git a/src/joystick/linux/Makefile.am b/src/joystick/linux/Makefile.am deleted file mode 100644 index 00b714e6..00000000 --- a/src/joystick/linux/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Linux joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_linux.la -libjoystick_linux_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index ed1456e0..1606a572 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -31,13 +31,13 @@ #include <linux/limits.h> /* Arm cross-compiler needs this */ #endif #include <linux/joystick.h> -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV #include <linux/input.h> #endif #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" /* Special joystick configurations */ static struct { @@ -168,7 +168,7 @@ struct joystick_hwdata { } *balls; /* Support for the Linux 2.4 unified input interface */ -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV SDL_bool is_hid; Uint8 key_map[KEY_MAX-BTN_MISC]; Uint8 abs_map[ABS_MAX]; @@ -257,7 +257,7 @@ static void LogicalSuffix(int logicalno, char* namebuf, int len) #endif /* USE_LOGICAL_JOYSTICKS */ -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV #define test_bit(nr, addr) \ (((1UL << ((nr) & 31)) & (((const unsigned int *) addr)[(nr) >> 5])) != 0) @@ -278,14 +278,14 @@ static int EV_IsJoystick(int fd) return(1); } -#endif /* USE_INPUT_EVENTS */ +#endif /* SDL_INPUT_LINUXEV */ /* Function to scan the system for joysticks */ int SDL_SYS_JoystickInit(void) { /* The base path of the joystick devices */ const char *joydev_pattern[] = { -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV "/dev/input/event%d", #endif "/dev/input/js%d", @@ -345,7 +345,7 @@ int SDL_SYS_JoystickInit(void) if ( fd < 0 ) { continue; } -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV #ifdef DEBUG_INPUT_EVENTS printf("Checking %s\n", path); #endif @@ -366,7 +366,7 @@ int SDL_SYS_JoystickInit(void) break; } -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV /* This is a special case... If the event devices are valid then the joystick devices will be duplicates but without extra information about their @@ -400,7 +400,7 @@ const char *SDL_SYS_JoystickName(int index) fd = open(SDL_joylist[index].fname, O_RDONLY, 0); if ( fd >= 0 ) { if ( -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) && #endif (ioctl(fd, JSIOCGNAME(sizeof(namebuf)), namebuf) <= 0) ) { @@ -540,7 +540,7 @@ static SDL_bool JS_ConfigJoystick(SDL_Joystick *joystick, int fd) return(handled); } -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd) { @@ -639,7 +639,7 @@ static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd) return(joystick->hwdata->is_hid); } -#endif /* USE_INPUT_EVENTS */ +#endif /* SDL_INPUT_LINUXEV */ #ifndef NO_LOGICAL_JOYSTICKS static void ConfigLogicalJoystick(SDL_Joystick *joystick) @@ -711,7 +711,7 @@ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) ConfigLogicalJoystick(joystick); else #endif -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV if ( ! EV_ConfigJoystick(joystick, fd) ) #endif JS_ConfigJoystick(joystick, fd); @@ -914,7 +914,7 @@ static __inline__ void JS_HandleEvents(SDL_Joystick *joystick) } } } -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV static __inline__ int EV_AxisCorrect(SDL_Joystick *joystick, int which, int value) { struct axis_correct *correct; @@ -1016,13 +1016,13 @@ static __inline__ void EV_HandleEvents(SDL_Joystick *joystick) } } } -#endif /* USE_INPUT_EVENTS */ +#endif /* SDL_INPUT_LINUXEV */ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) { int i; -#ifdef USE_INPUT_EVENTS +#if SDL_INPUT_LINUXEV if ( joystick->hwdata->is_hid ) EV_HandleEvents(joystick); else diff --git a/src/joystick/macos/Makefile.am b/src/joystick/macos/Makefile.am deleted file mode 100644 index 29ef4872..00000000 --- a/src/joystick/macos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the MacOS joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_macos.la -libjoystick_macos_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/macos/SDL_sysjoystick.c b/src/joystick/macos/SDL_sysjoystick.c index 8cef2f3a..eb605b20 100644 --- a/src/joystick/macos/SDL_sysjoystick.c +++ b/src/joystick/macos/SDL_sysjoystick.c @@ -29,8 +29,8 @@ #include <InputSprocket.h> #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" /* The max number of joysticks we will detect */ diff --git a/src/joystick/mint/Makefile.am b/src/joystick/mint/Makefile.am deleted file mode 100644 index 9f17a7ee..00000000 --- a/src/joystick/mint/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the MiNT joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_mint.la -libjoystick_mint_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/mint/SDL_sysjoystick.c b/src/joystick/mint/SDL_sysjoystick.c index 33270a91..e775504f 100644 --- a/src/joystick/mint/SDL_sysjoystick.c +++ b/src/joystick/mint/SDL_sysjoystick.c @@ -30,8 +30,8 @@ #include <mint/osbind.h> #include "SDL_events.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" #include "SDL_ikbdinterrupt_s.h" #include "SDL_xbiosevents_c.h" diff --git a/src/joystick/os2/SDL_sysjoystick.c b/src/joystick/os2/SDL_sysjoystick.c index d0ccec75..708dd761 100644 --- a/src/joystick/os2/SDL_sysjoystick.c +++ b/src/joystick/os2/SDL_sysjoystick.c @@ -31,8 +31,8 @@ #include "joyos2.h" #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" HFILE hJoyPort = NULL; /* Joystick GAME$ Port Address */ #define MAX_JOYSTICKS 2 /* Maximum of two joysticks */ diff --git a/src/joystick/riscos/Makefile.am b/src/joystick/riscos/Makefile.am deleted file mode 100644 index ef5c85d5..00000000 --- a/src/joystick/riscos/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the RISC OS joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_riscos.la -libjoystick_riscos_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_sysjoystick.c diff --git a/src/joystick/riscos/SDL_sysjoystick.c b/src/joystick/riscos/SDL_sysjoystick.c index 51ad7217..ab12f698 100644 --- a/src/joystick/riscos/SDL_sysjoystick.c +++ b/src/joystick/riscos/SDL_sysjoystick.c @@ -30,8 +30,8 @@ /* This is the system specific header for the SDL joystick API */ #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" #include "kernel.h" diff --git a/src/joystick/win32/Makefile.am b/src/joystick/win32/Makefile.am deleted file mode 100644 index c46e4013..00000000 --- a/src/joystick/win32/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ - -## Makefile.am for the Windows MultiMedia joystick driver for SDL - -noinst_LTLIBRARIES = libjoystick_winmm.la -libjoystick_winmm_la_SOURCES = $(SRCS) - -# The SDL joystick driver sources -SRCS = SDL_mmjoystick.c diff --git a/src/joystick/win32/SDL_mmjoystick.c b/src/joystick/win32/SDL_mmjoystick.c index 3d180f75..a020ae9f 100644 --- a/src/joystick/win32/SDL_mmjoystick.c +++ b/src/joystick/win32/SDL_mmjoystick.c @@ -28,8 +28,8 @@ #include "SDL_events.h" #include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" #define MAX_JOYSTICKS 16 #define MAX_AXES 6 /* each joystick can have up to 6 axes */ diff --git a/src/loadso/beos/SDL_loadso.c b/src/loadso/beos/SDL_sysloadso.c index 42b679e7..089df5bd 100644 --- a/src/loadso/beos/SDL_loadso.c +++ b/src/loadso/beos/SDL_sysloadso.c @@ -23,14 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(__BEOS__) -#error Compiling for the wrong platform? -#endif - #include <stdio.h> #include <be/kernel/image.h> diff --git a/src/loadso/dlopen/SDL_loadso.c b/src/loadso/dlopen/SDL_sysloadso.c index d02d2029..ba207207 100644 --- a/src/loadso/dlopen/SDL_loadso.c +++ b/src/loadso/dlopen/SDL_sysloadso.c @@ -23,14 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(USE_DLOPEN) -#error Compiling for the wrong platform? -#endif - #include <stdio.h> #include <dlfcn.h> @@ -50,7 +42,14 @@ void *SDL_LoadFunction(void *handle, const char *name) { void *symbol = dlsym(handle, name); if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror()); + char *_name = SDL_stack_alloc(char, 1+SDL_strlen(name)+1); + _name[0] = '_'; + SDL_strcpy(&_name[1], name); + symbol = dlsym(handle, name); + SDL_stack_free(_name); + if ( symbol == NULL ) { + SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror()); + } } return(symbol); } diff --git a/src/loadso/dummy/SDL_loadso.c b/src/loadso/dummy/SDL_sysloadso.c index 58df827c..7795893f 100644 --- a/src/loadso/dummy/SDL_loadso.c +++ b/src/loadso/dummy/SDL_sysloadso.c @@ -23,10 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - #include "SDL_loadso.h" void *SDL_LoadObject(const char *sofile) diff --git a/src/loadso/macos/SDL_loadso.c b/src/loadso/macos/SDL_sysloadso.c index 61fb044a..ccd5d1c1 100644 --- a/src/loadso/macos/SDL_loadso.c +++ b/src/loadso/macos/SDL_sysloadso.c @@ -23,14 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(macintosh) -#error Compiling for the wrong platform? -#endif - #include <stdio.h> #include <string.h> #define OLDP2C 1 diff --git a/src/loadso/macosx/SDL_loadso.c b/src/loadso/macosx/SDL_sysloadso.c index f7b59c5b..e1851fc1 100644 --- a/src/loadso/macosx/SDL_loadso.c +++ b/src/loadso/macosx/SDL_sysloadso.c @@ -1371,16 +1371,6 @@ static dlfunc_t SDL_OSX_dlfunc(void * dl_restrict handle, const char * dl_restri /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(MACOSX) -#error Compiling for the wrong platform? -#elif defined(USE_DLOPEN) -#error Do not use USE_DLOPEN on Mac OS X. -#endif - #include "SDL_loadso.h" void *SDL_LoadObject(const char *sofile) @@ -1409,4 +1399,3 @@ void SDL_UnloadObject(void *handle) } } - diff --git a/src/loadso/mint/SDL_loadso.c b/src/loadso/mint/SDL_sysloadso.c index 82c46b86..2e13106f 100644 --- a/src/loadso/mint/SDL_loadso.c +++ b/src/loadso/mint/SDL_sysloadso.c @@ -23,15 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -/* please use the "dummy" driver if you don't have LDG support enabled. */ -#if !defined(__MINT__) || !defined(ENABLE_LDG) -#error Compiling for the wrong platform? -#endif - #include <stdio.h> #include <gem.h> #include <ldg.h> diff --git a/src/loadso/os2/SDL_loadso.c b/src/loadso/os2/SDL_sysloadso.c index e3c04b42..2e5af151 100644 --- a/src/loadso/os2/SDL_loadso.c +++ b/src/loadso/os2/SDL_sysloadso.c @@ -23,14 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(__OS2__) -#error Compiling for the wrong platform? -#endif - #include <stdio.h> #define INCL_DOSERRORS #define INCL_DOSMODULEMGR diff --git a/src/loadso/windows/SDL_loadso.c b/src/loadso/win32/SDL_sysloadso.c index 87ad6a9d..82ac900d 100644 --- a/src/loadso/windows/SDL_loadso.c +++ b/src/loadso/win32/SDL_sysloadso.c @@ -23,14 +23,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#if !SDL_INTERNAL_BUILDING_LOADSO -#error Do not compile directly...compile src/SDL_loadso.c instead! -#endif - -#if !defined(WIN32) && !defined(_WIN32_WCE) -#error Compiling for the wrong platform? -#endif - #include "SDL_windows.h" #include "SDL_loadso.h" diff --git a/src/main/Makefile.am b/src/main/Makefile.am index e7f68cc8..951093d6 100644 --- a/src/main/Makefile.am +++ b/src/main/Makefile.am @@ -4,14 +4,6 @@ # This is necessary because some platforms have special program # entry points, which require special application initialization. -ARCH_SUBDIRS = $(srcdir)/beos \ - $(srcdir)/epoc \ - $(srcdir)/dummy \ - $(srcdir)/macos \ - $(srcdir)/macosx \ - $(srcdir)/qtopia \ - $(srcdir)/win32 - # Build a separate library containing the main() entry point. lib_LIBRARIES = libSDLmain.a @@ -48,11 +40,6 @@ endif libarch_la_SOURCES = $(ARCH_SRCS) exports: - for i in $(ARCH_SUBDIRS); do if [ -d $$i/exports ]; then (cd $$i/exports; make); fi; done - -# The architecture specific directories need to be copied into place -# when building a distribution. -dist-hook: - (cd $(distdir) && rm -f $(BUILT_SOURCES)) - cp -rp $(ARCH_SUBDIRS) $(distdir) - (cd $(distdir) && rm -rf `find . -name CVS`) + for i in $(srcdir)/*; do if [ -d $$i/exports ]; then (cd $$i/exports; make); fi; done + +EXTRA_DIST = beos dummy epoc linux macos macosx qtopia win32 diff --git a/src/main/win32/SDL_win32_main.c b/src/main/win32/SDL_win32_main.c index 4830e010..25897fc3 100644 --- a/src/main/win32/SDL_win32_main.c +++ b/src/main/win32/SDL_win32_main.c @@ -220,27 +220,12 @@ int console_main(int argc, char *argv[]) atexit(cleanup_output); atexit(SDL_Quit); -#ifndef DISABLE_VIDEO -#if 0 - /* Create and register our class * - DJM: If we do this here, the user nevers gets a chance to - putenv(SDL_WINDOWID). This is already called later by - the (DIB|DX5)_CreateWindow function, so it should be - safe to comment it out here. - if ( SDL_RegisterApp(appname, CS_BYTEALIGNCLIENT, - GetModuleHandle(NULL)) < 0 ) { - ShowError("WinMain() error", SDL_GetError()); - exit(1); - }*/ -#else /* Sam: We still need to pass in the application handle so that DirectInput will initialize properly when SDL_RegisterApp() is called later in the video initialization. */ SDL_SetModuleHandle(GetModuleHandle(NULL)); -#endif /* 0 */ -#endif /* !DISABLE_VIDEO */ /* Run the application main() code */ SDL_main(argc, argv); diff --git a/src/stdlib/Makefile.am b/src/stdlib/Makefile.am deleted file mode 100644 index 254b0a0e..00000000 --- a/src/stdlib/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for the SDL file library - -noinst_LTLIBRARIES = libstdlib.la - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_getenv.c \ - SDL_malloc.c \ - SDL_qsort.c \ - SDL_stdlib.c \ - SDL_string.c - -libstdlib_la_SOURCES = $(COMMON_SRCS) - diff --git a/src/thread/Makefile.am b/src/thread/Makefile.am deleted file mode 100644 index bf9f3edf..00000000 --- a/src/thread/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ - -## Makefile.am for the SDL thread library - -noinst_LTLIBRARIES = libthread.la - -ARCH_SUBDIRS = $(srcdir)/generic \ - $(srcdir)/amigaos \ - $(srcdir)/beos \ - $(srcdir)/bsdi \ - $(srcdir)/dc \ - $(srcdir)/epoc \ - $(srcdir)/irix \ - $(srcdir)/linux \ - $(srcdir)/pth \ - $(srcdir)/win32 - -# Older versions of Linux require an asm clone() implementation -if USE_CLONE -THREAD_ASM_SRC = linux/clone.S -else -THREAD_ASM_SRC = -endif - -COMMON_SRCS = \ - SDL_systhread.h \ - SDL_thread.c \ - SDL_thread_c.h -ARCH_SRCS = \ - SDL_systhread.c \ - SDL_systhread_c.h \ - SDL_sysmutex.c \ - SDL_sysmutex_c.h \ - SDL_syssem.c \ - SDL_syssem_c.h \ - SDL_syscond.c \ - SDL_syscond_c.h \ - $(THREAD_ASM_SRC) - -libthread_la_SOURCES = $(COMMON_SRCS) $(ARCH_SRCS) - -## Let automake know that it shouldn't distribute linked sources -BUILT_SOURCES = $(ARCH_SRCS) - -## Let automake know that it should remove these for distribution -DISTCLEANFILES = $(ARCH_SRCS) - -# The architecture specific directories need to be copied into place -# when building a distribution. -dist-hook: - (cd $(distdir) && rm -f $(BUILT_SOURCES)) - cp -rp $(ARCH_SUBDIRS) $(distdir) - (cd $(distdir) && rm -rf `find . -name CVS`) diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h index 7747b6aa..eefabcd1 100644 --- a/src/thread/SDL_systhread.h +++ b/src/thread/SDL_systhread.h @@ -22,7 +22,10 @@ /* These are functions that need to be implemented by a port of SDL */ -#include "SDL_thread_c.h" +#ifndef _SDL_systhread_h +#define _SDL_systhread_h + +#include "SDL_thread.h" /* This function creates a thread, passing args to SDL_RunThread(), saves a system-dependent thread id in thread->id, and returns 0 @@ -45,3 +48,4 @@ extern void SDL_SYS_WaitThread(SDL_Thread *thread); /* This function kills the thread and returns */ extern void SDL_SYS_KillThread(SDL_Thread *thread); +#endif /* _SDL_systhread_h */ diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index de1679e7..4028a1de 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -23,8 +23,32 @@ #ifndef _SDL_thread_c_h #define _SDL_thread_c_h -#include "SDL_error_c.h" -#include "SDL_systhread_c.h" +/* Need the definitions of SYS_ThreadHandle */ +#if SDL_THREADS_DISABLED +#include "generic/SDL_systhread_c.h" +#elif SDL_THREAD_AMIGA +#include "amigaos/SDL_systhread_c.h" +#elif SDL_THREAD_BEOS +#include "beos/SDL_systhread_c.h" +#elif SDL_THREAD_DC +#include "dc/SDL_systhread_c.h" +#elif SDL_THREAD_EPOC +#include "epoc/SDL_systhread_c.h" +#elif SDL_THREAD_OS2 +#include "os2/SDL_systhread_c.h" +#elif SDL_THREAD_PTH +#include "pth/SDL_systhread_c.h" +#elif SDL_THREAD_PTHREAD +#include "pthread/SDL_systhread_c.h" +#elif SDL_THREAD_SPROC +#include "irix/SDL_systhread_c.h" +#elif SDL_THREAD_WIN32 +#include "win32/SDL_systhread_c.h" +#else +#error Need thread implementation for this platform +#include "generic/SDL_systhread_c.h" +#endif +#include "../SDL_error_c.h" /* This is the system-independent thread info structure */ struct SDL_Thread { @@ -38,7 +62,4 @@ struct SDL_Thread { /* This is the function called to run a thread */ extern void SDL_RunThread(void *data); -/* Routine to get the thread-specific error variable */ -extern SDL_error *SDL_GetErrBuf(void); - #endif /* _SDL_thread_c_h */ diff --git a/src/thread/amigaos/SDL_syssem.c b/src/thread/amigaos/SDL_syssem.c index 1222b687..f917c8c1 100644 --- a/src/thread/amigaos/SDL_syssem.c +++ b/src/thread/amigaos/SDL_syssem.c @@ -29,10 +29,6 @@ struct SDL_semaphore { struct SignalSemaphore Sem; - Uint32 count; - Uint32 waiters_count; - SDL_mutex *count_lock; - SDL_cond *count_nonzero; }; #undef D @@ -98,20 +94,9 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) /* A timeout of 0 is an easy case */ if ( timeout == 0 ) { - return SDL_SemTryWait(sem); + ObtainSemaphore(&sem->Sem); + return 1; } -/* - SDL_LockMutex(sem->count_lock); - ++sem->waiters_count; - retval = 0; - while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) { - retval = SDL_CondWaitTimeout(sem->count_nonzero, - sem->count_lock, timeout); - } - --sem->waiters_count; - --sem->count; - SDL_UnlockMutex(sem->count_lock); -*/ if(!(retval=AttemptSemaphore(&sem->Sem))) { SDL_Delay(timeout); @@ -131,7 +116,6 @@ int SDL_SemWait(SDL_sem *sem) { ObtainSemaphore(&sem->Sem); return 0; -// return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } Uint32 SDL_SemValue(SDL_sem *sem) @@ -145,7 +129,6 @@ Uint32 SDL_SemValue(SDL_sem *sem) #else value = sem->Sem.ss_NestCount; #endif -// SDL_UnlockMutex(sem->count_lock); } return value; } @@ -159,14 +142,6 @@ int SDL_SemPost(SDL_sem *sem) D(bug("SemPost semaphore...%lx\n",sem)); ReleaseSemaphore(&sem->Sem); -#if 0 - SDL_LockMutex(sem->count_lock); - if ( sem->waiters_count > 0 ) { - SDL_CondSignal(sem->count_nonzero); - } - ++sem->count; - SDL_UnlockMutex(sem->count_lock); -#endif return 0; } diff --git a/src/thread/amigaos/SDL_systhread.c b/src/thread/amigaos/SDL_systhread.c index 6fabd2ff..80488a10 100644 --- a/src/thread/amigaos/SDL_systhread.c +++ b/src/thread/amigaos/SDL_systhread.c @@ -24,8 +24,8 @@ #include "SDL_mutex.h" #include "SDL_thread.h" -#include "SDL_thread_c.h" -#include "SDL_systhread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" #include "mydebug.h" typedef struct { diff --git a/src/thread/amigaos/SDL_thread.c b/src/thread/amigaos/SDL_thread.c index e73f7c73..cb90b611 100644 --- a/src/thread/amigaos/SDL_thread.c +++ b/src/thread/amigaos/SDL_thread.c @@ -24,8 +24,8 @@ #include "SDL_mutex.h" #include "SDL_thread.h" -#include "SDL_thread_c.h" -#include "SDL_systhread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" #define ARRAY_CHUNKSIZE 32 /* The array of threads currently active in the application diff --git a/src/thread/beos/SDL_systhread.c b/src/thread/beos/SDL_systhread.c index 5ba04da8..f38e1663 100644 --- a/src/thread/beos/SDL_systhread.c +++ b/src/thread/beos/SDL_systhread.c @@ -28,8 +28,8 @@ #include "SDL_mutex.h" #include "SDL_thread.h" -#include "SDL_thread_c.h" -#include "SDL_systhread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" static int sig_list[] = { diff --git a/src/thread/bsdi/SDL_syssem.c b/src/thread/bsdi/SDL_syssem.c deleted file mode 100644 index 57b7bc07..00000000 --- a/src/thread/bsdi/SDL_syssem.c +++ /dev/null @@ -1,498 +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 -*/ - -#include "SDL_thread.h" -#include "SDL_timer.h" - -#ifdef SDL_USE_PTHREADS - -#include <unistd.h> /* For getpid() */ -#include <pthread.h> - - -/* - * This is semaphore.h inlined here so that BSD/OS POSIX semaphore are - * completely selfcontained without requiring any additional include files - * or libraries not present in the stock system -*/ - -/* semaphore.h: POSIX 1003.1b semaphores */ - -/*- - * Copyright (c) 1996, 1997 - * HD Associates, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by HD Associates, Inc - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/posix4/semaphore.h,v 1.6 2000/01/20 07:55:42 jasone Exp $ - */ - -#include <machine/limits.h> - -#include <sys/types.h> -#include <fcntl.h> - -/* Opaque type definition. */ -struct sem; -typedef struct sem *sem_t; - -#define SEM_FAILED ((sem_t *)0) -#define SEM_VALUE_MAX UINT_MAX - -#include <sys/cdefs.h> - -__BEGIN_DECLS -int sem_init __P((sem_t *, int, unsigned int)); -int sem_destroy __P((sem_t *)); -sem_t *sem_open __P((const char *, int, ...)); -int sem_close __P((sem_t *)); -int sem_unlink __P((const char *)); -int sem_wait __P((sem_t *)); -int sem_trywait __P((sem_t *)); -int sem_post __P((sem_t *)); -int sem_getvalue __P((sem_t *, int *)); -__END_DECLS - -/* END of inlined semaphore.h */ - -/* Wrapper around POSIX 1003.1b semaphores */ - -struct SDL_semaphore { - sem_t *sem; - sem_t sem_data; -}; - -/* Create a semaphore, initialized with value */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); - if ( sem ) { - if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { - SDL_SetError("sem_init() failed"); - SDL_free(sem); - sem = NULL; - } else { - sem->sem = &sem->sem_data; - } - } else { - SDL_OutOfMemory(); - } - return sem; -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { - sem_destroy(sem->sem); - SDL_free(sem); - } -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - retval = SDL_MUTEX_TIMEDOUT; - if ( sem_trywait(sem->sem) == 0 ) - retval = 0; - return retval; -} - -int SDL_SemWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_wait(sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_wait() failed"); - } - return retval; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* Try the easy cases first */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - if ( timeout == SDL_MUTEX_MAXWAIT ) { - return SDL_SemWait(sem); - } - - /* Ack! We have to busy wait... */ - timeout += SDL_GetTicks(); - do { - retval = SDL_SemTryWait(sem); - if ( retval == 0 ) { - break; - } - SDL_Delay(1); - } while ( SDL_GetTicks() < timeout ); - - return retval; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - int ret = 0; - if ( sem ) { - sem_getvalue(sem->sem, &ret); - if ( ret < 0 ) { - ret = 0; - } - } - return (Uint32)ret; -} - -int SDL_SemPost(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_post(sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_post() failed"); - } - return retval; -} - -/* - * BEGIN inlined uthread_sem.c. This is done here so that no extra libraries - * or include files not present in BSD/OS are required -*/ - -/* - * Copyright (C) 2000 Jason Evans <jasone@freebsd.org>. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice(s), this list of conditions and the following disclaimer as - * the first lines of this file unmodified other than the possible - * addition of one or more copyright notices. - * 2. Redistributions in binary form must reproduce the above copyright - * notice(s), this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc_r/uthread/uthread_sem.c,v 1.3.2.1 2000/07/18 02:05:57 jasone Exp $ - */ - -#include <errno.h> -#include <pthread.h> - -/* Begin thread_private.h kluge */ -/* - * These come out of (or should go into) thread_private.h - rather than have - * to copy (or symlink) the files from the source tree these definitions are - * inlined here. Obviously these go away when this module is part of libc. -*/ -struct sem { -#define SEM_MAGIC ((u_int32_t) 0x09fa4012) - u_int32_t magic; - pthread_mutex_t lock; - pthread_cond_t gtzero; - u_int32_t count; - u_int32_t nwaiters; -}; - -extern pthread_once_t _thread_init_once; -extern int _threads_initialized; -extern void _thread_init __P((void)); -#define THREAD_INIT() \ - (void) pthread_once(&_thread_init_once, _thread_init) -#define THREAD_SAFE() \ - (_threads_initialized != 0) - -#define _SEM_CHECK_VALIDITY(sem) \ - if ((*(sem))->magic != SEM_MAGIC) { \ - errno = EINVAL; \ - retval = -1; \ - goto RETURN; \ - } -/* End thread_private.h kluge */ - -int -sem_init(sem_t *sem, int pshared, unsigned int value) -{ - int retval; - - if (!THREAD_SAFE()) - THREAD_INIT(); - - /* - * Range check the arguments. - */ - if (pshared != 0) { - /* - * The user wants a semaphore that can be shared among - * processes, which this implementation can't do. Sounds like a - * permissions problem to me (yeah right). - */ - errno = EPERM; - retval = -1; - goto RETURN; - } - - if (value > SEM_VALUE_MAX) { - errno = EINVAL; - retval = -1; - goto RETURN; - } - - *sem = (sem_t)SDL_malloc(sizeof(struct sem)); - if (*sem == NULL) { - errno = ENOSPC; - retval = -1; - goto RETURN; - } - - /* - * Initialize the semaphore. - */ - if (pthread_mutex_init(&(*sem)->lock, NULL) != 0) { - SDL_free(*sem); - errno = ENOSPC; - retval = -1; - goto RETURN; - } - - if (pthread_cond_init(&(*sem)->gtzero, NULL) != 0) { - pthread_mutex_destroy(&(*sem)->lock); - SDL_free(*sem); - errno = ENOSPC; - retval = -1; - goto RETURN; - } - - (*sem)->count = (u_int32_t)value; - (*sem)->nwaiters = 0; - (*sem)->magic = SEM_MAGIC; - - retval = 0; - RETURN: - return retval; -} - -int -sem_destroy(sem_t *sem) -{ - int retval; - - _SEM_CHECK_VALIDITY(sem); - - /* Make sure there are no waiters. */ - pthread_mutex_lock(&(*sem)->lock); - if ((*sem)->nwaiters > 0) { - pthread_mutex_unlock(&(*sem)->lock); - errno = EBUSY; - retval = -1; - goto RETURN; - } - pthread_mutex_unlock(&(*sem)->lock); - - pthread_mutex_destroy(&(*sem)->lock); - pthread_cond_destroy(&(*sem)->gtzero); - (*sem)->magic = 0; - - SDL_free(*sem); - - retval = 0; - RETURN: - return retval; -} - -sem_t * -sem_open(const char *name, int oflag, ...) -{ - errno = ENOSYS; - return SEM_FAILED; -} - -int -sem_close(sem_t *sem) -{ - errno = ENOSYS; - return -1; -} - -int -sem_unlink(const char *name) -{ - errno = ENOSYS; - return -1; -} - -int -sem_wait(sem_t *sem) -{ - int retval; - - pthread_testcancel(); - - _SEM_CHECK_VALIDITY(sem); - - pthread_mutex_lock(&(*sem)->lock); - - while ((*sem)->count == 0) { - (*sem)->nwaiters++; - pthread_cond_wait(&(*sem)->gtzero, &(*sem)->lock); - (*sem)->nwaiters--; - } - (*sem)->count--; - - pthread_mutex_unlock(&(*sem)->lock); - - retval = 0; - RETURN: - - pthread_testcancel(); - return retval; -} - -int -sem_trywait(sem_t *sem) -{ - int retval; - - _SEM_CHECK_VALIDITY(sem); - - pthread_mutex_lock(&(*sem)->lock); - - if ((*sem)->count > 0) { - (*sem)->count--; - retval = 0; - } else { - errno = EAGAIN; - retval = -1; - } - - pthread_mutex_unlock(&(*sem)->lock); - - RETURN: - return retval; -} - -int -sem_post(sem_t *sem) -{ - int retval; - - _SEM_CHECK_VALIDITY(sem); - - pthread_mutex_lock(&(*sem)->lock); - - (*sem)->count++; - if ((*sem)->nwaiters > 0) { - /* - * We must use pthread_cond_broadcast() rather than - * pthread_cond_signal() in order to assure that the highest - * priority thread is run by the scheduler, since - * pthread_cond_signal() signals waiting threads in FIFO order. - */ - pthread_cond_broadcast(&(*sem)->gtzero); - } - - pthread_mutex_unlock(&(*sem)->lock); - - retval = 0; - RETURN: - return retval; -} - -int -sem_getvalue(sem_t *sem, int *sval) -{ - int retval; - - _SEM_CHECK_VALIDITY(sem); - - pthread_mutex_lock(&(*sem)->lock); - *sval = (int)(*sem)->count; - pthread_mutex_unlock(&(*sem)->lock); - - retval = 0; - RETURN: - return retval; -} - -/* END of inlined uthread_sem.c */ -#endif /* SDL_USE_PTHREADS */ diff --git a/src/thread/dc/SDL_sysmutex.c b/src/thread/dc/SDL_sysmutex.c index 2160107d..5cd66f91 100644 --- a/src/thread/dc/SDL_sysmutex.c +++ b/src/thread/dc/SDL_sysmutex.c @@ -61,8 +61,8 @@ void SDL_DestroyMutex(SDL_mutex *mutex) /* Lock the semaphore */ int SDL_mutexP(SDL_mutex *mutex) { -#ifdef DISABLE_THREADS - return 0; +#if SDL_THREADS_DISABLED + return SDL_arraysize(return ),0; #else Uint32 this_thread; @@ -85,13 +85,13 @@ int SDL_mutexP(SDL_mutex *mutex) } return 0; -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ } /* Unlock the mutex */ int SDL_mutexV(SDL_mutex *mutex) { -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED return 0; #else if ( mutex == NULL ) { @@ -117,5 +117,5 @@ int SDL_mutexV(SDL_mutex *mutex) spinlock_unlock(&mutex->mutex); } return 0; -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ } diff --git a/src/thread/dc/SDL_syssem.c b/src/thread/dc/SDL_syssem.c index 8f9368cf..1cf21e35 100644 --- a/src/thread/dc/SDL_syssem.c +++ b/src/thread/dc/SDL_syssem.c @@ -27,7 +27,7 @@ #include "SDL_systhread_c.h" -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { @@ -164,4 +164,4 @@ int SDL_SemPost(SDL_sem *sem) return 0; } -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ diff --git a/src/thread/dc/SDL_systhread.c b/src/thread/dc/SDL_systhread.c index 05b9fb4a..c3318cae 100644 --- a/src/thread/dc/SDL_systhread.c +++ b/src/thread/dc/SDL_systhread.c @@ -23,11 +23,11 @@ /* Thread management routines for SDL */ #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" #include <kos/thread.h> -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { SDL_SetError("Threads are not supported on this platform"); diff --git a/src/thread/dc/SDL_systhread_c.h b/src/thread/dc/SDL_systhread_c.h index b763fa65..6de1d653 100644 --- a/src/thread/dc/SDL_systhread_c.h +++ b/src/thread/dc/SDL_systhread_c.h @@ -20,10 +20,4 @@ slouken@libsdl.org */ -/* Stub until we implement threads on this platform */ typedef struct kthread* SYS_ThreadHandle; -/* -#ifndef DISABLE_THREADS -#define DISABLE_THREADS -#endif -*/ diff --git a/src/thread/epoc/SDL_systhread.cpp b/src/thread/epoc/SDL_systhread.cpp index dad59955..c4ebd090 100644 --- a/src/thread/epoc/SDL_systhread.cpp +++ b/src/thread/epoc/SDL_systhread.cpp @@ -32,7 +32,7 @@ extern "C" { #undef NULL #include "SDL_error.h" #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" }; #include <e32std.h> diff --git a/src/thread/generic/SDL_syscond_c.h b/src/thread/generic/SDL_syscond_c.h deleted file mode 100644 index 39e122db..00000000 --- a/src/thread/generic/SDL_syscond_c.h +++ /dev/null @@ -1,22 +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 -*/ - diff --git a/src/thread/generic/SDL_sysmutex.c b/src/thread/generic/SDL_sysmutex.c index 4b173309..5eadce34 100644 --- a/src/thread/generic/SDL_sysmutex.c +++ b/src/thread/generic/SDL_sysmutex.c @@ -68,7 +68,7 @@ void SDL_DestroyMutex(SDL_mutex *mutex) /* Lock the semaphore */ int SDL_mutexP(SDL_mutex *mutex) { -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED return 0; #else Uint32 this_thread; @@ -92,13 +92,13 @@ int SDL_mutexP(SDL_mutex *mutex) } return 0; -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ } /* Unlock the mutex */ int SDL_mutexV(SDL_mutex *mutex) { -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED return 0; #else if ( mutex == NULL ) { @@ -124,5 +124,5 @@ int SDL_mutexV(SDL_mutex *mutex) SDL_SemPost(mutex->sem); } return 0; -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ } diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index 1aea8d68..30e9942f 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -27,7 +27,7 @@ #include "SDL_systhread_c.h" -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { @@ -203,4 +203,4 @@ int SDL_SemPost(SDL_sem *sem) return 0; } -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ diff --git a/src/thread/generic/SDL_syssem_c.h b/src/thread/generic/SDL_syssem_c.h deleted file mode 100644 index 39e122db..00000000 --- a/src/thread/generic/SDL_syssem_c.h +++ /dev/null @@ -1,22 +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 -*/ - diff --git a/src/thread/generic/SDL_systhread.c b/src/thread/generic/SDL_systhread.c index 89b4f9b2..f5d5e0ac 100644 --- a/src/thread/generic/SDL_systhread.c +++ b/src/thread/generic/SDL_systhread.c @@ -23,7 +23,7 @@ /* Thread management routines for SDL */ #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { diff --git a/src/thread/generic/SDL_systhread_c.h b/src/thread/generic/SDL_systhread_c.h index d0830eb7..23c3e027 100644 --- a/src/thread/generic/SDL_systhread_c.h +++ b/src/thread/generic/SDL_systhread_c.h @@ -22,7 +22,3 @@ /* Stub until we implement threads on this platform */ typedef int SYS_ThreadHandle; - -#ifndef DISABLE_THREADS -#define DISABLE_THREADS -#endif diff --git a/src/thread/linux/SDL_syssem.c b/src/thread/irix/SDL_syssem.c index 881f4f46..9f58748e 100644 --- a/src/thread/linux/SDL_syssem.c +++ b/src/thread/irix/SDL_syssem.c @@ -23,180 +23,6 @@ #include "SDL_thread.h" #include "SDL_timer.h" -#ifdef linux -/* Look to see if glibc is available, and if so, what version */ -#include <features.h> - -#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) -#warning Working around a bug in glibc 2.0 pthreads -#undef SDL_USE_PTHREADS -/* The bug is actually a problem where threads are suspended, but don't - wake up when the thread manager sends them a signal. This is a problem - with thread creation too, but it happens less often. :-/ - We avoid this by using System V IPC for semaphores. - */ -#endif /* glibc 2.0 */ -#endif /* linux */ - -#ifdef SDL_USE_PTHREADS - -#ifdef SDL_NO_PTHREAD_SEMAPHORES -#include "generic/SDL_syssem.c" -#else - -#include <pthread.h> -#include <semaphore.h> - -/* Wrapper around POSIX 1003.1b semaphores */ - -#ifdef MACOSX -#define USE_NAMED_SEMAPHORES -#endif /* MACOSX */ - -struct SDL_semaphore { - sem_t *sem; -#ifndef USE_NAMED_SEMAPHORES - sem_t sem_data; -#endif -}; - -/* Create a semaphore, initialized with value */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); - if ( sem ) { -#ifdef USE_NAMED_SEMAPHORES - static int semnum = 0; - char name[32]; - - SDL_snprintf(name, SDL_arraysize(name), "/SDL_sem-%d-%4.4d", getpid(), semnum++); - sem->sem = sem_open(name, O_CREAT, 0600, initial_value); - if ( sem->sem == (sem_t *)SEM_FAILED ) { - SDL_SetError("sem_open(%s) failed", name); - SDL_free(sem); - sem = NULL; - } else { - sem_unlink(name); - } -#else - if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { - SDL_SetError("sem_init() failed"); - SDL_free(sem); - sem = NULL; - } else { - sem->sem = &sem->sem_data; - } -#endif /* USE_NAMED_SEMAPHORES */ - } else { - SDL_OutOfMemory(); - } - return sem; -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { -#ifdef USE_NAMED_SEMAPHORES - sem_close(sem->sem); -#else - sem_destroy(sem->sem); -#endif - SDL_free(sem); - } -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - retval = SDL_MUTEX_TIMEDOUT; - if ( sem_trywait(sem->sem) == 0 ) { - retval = 0; - } - return retval; -} - -int SDL_SemWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_wait(sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_wait() failed"); - } - return retval; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* Try the easy cases first */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - if ( timeout == SDL_MUTEX_MAXWAIT ) { - return SDL_SemWait(sem); - } - - /* Ack! We have to busy wait... */ - timeout += SDL_GetTicks(); - do { - retval = SDL_SemTryWait(sem); - if ( retval == 0 ) { - break; - } - SDL_Delay(1); - } while ( SDL_GetTicks() < timeout ); - - return retval; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - int ret = 0; - if ( sem ) { - sem_getvalue(sem->sem, &ret); - if ( ret < 0 ) { - ret = 0; - } - } - return (Uint32)ret; -} - -int SDL_SemPost(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_post(sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_post() failed"); - } - return retval; -} - -#endif /* NO_PTHREAD_SEMAPHORES */ - -#else /* System V IPC implementation */ #include <stdio.h> #include <stdlib.h> @@ -214,6 +40,7 @@ struct SDL_semaphore { }; /* Not defined by many operating systems, use configure to detect */ +/* #if !defined(HAVE_SEMUN) union semun { int val; @@ -221,6 +48,7 @@ union semun { ushort *array; }; #endif +*/ static struct sembuf op_trywait[2] = { { 0, -1, (IPC_NOWAIT|SEM_UNDO) } /* Decrement semaphore, no block */ @@ -405,5 +233,3 @@ int SDL_SemPost(SDL_sem *sem) } return retval; } - -#endif /* SDL_USE_PTHREADS */ diff --git a/src/thread/irix/SDL_systhread.c b/src/thread/irix/SDL_systhread.c index 4433f406..52e06010 100644 --- a/src/thread/irix/SDL_systhread.c +++ b/src/thread/irix/SDL_systhread.c @@ -29,7 +29,7 @@ #include <sys/prctl.h> #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" static int sig_list[] = { diff --git a/src/thread/linux/SDL_systhread.c b/src/thread/linux/SDL_systhread.c deleted file mode 100644 index 5c541758..00000000 --- a/src/thread/linux/SDL_systhread.c +++ /dev/null @@ -1,244 +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 -*/ - -/* Linux thread management routines for SDL */ - -#include "SDL_thread.h" -#include "SDL_systhread.h" - -#ifdef FORK_HACK - -#include <unistd.h> - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - SDL_SetError("Threads are not supported on this platform"); - return(-1); -} -void SDL_SYS_SetupThread(void) -{ - return; -} -Uint32 SDL_ThreadID(void) -{ - return((Uint32)getpid()); -} -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - return; -} -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - return; -} - -#else - -#include <signal.h> - -/* List of signals to mask in the subthreads */ -static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, - SIGVTALRM, SIGPROF, 0 -}; - -#ifdef SDL_USE_PTHREADS - -#include <pthread.h> - - -static void *RunThread(void *data) -{ - SDL_RunThread(data); - pthread_exit((void*)0); - return((void *)0); /* Prevent compiler warning */ -} - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - pthread_attr_t type; - - /* Set the thread attributes */ - if ( pthread_attr_init(&type) != 0 ) { - SDL_SetError("Couldn't initialize pthread attributes"); - return(-1); - } - pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); - - /* Create the thread and go! */ - if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - int i; - sigset_t mask; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - pthread_sigmask(SIG_BLOCK, &mask, 0); - -#ifdef PTHREAD_CANCEL_ASYNCHRONOUS - /* Allow ourselves to be asynchronously cancelled */ - { int oldstate; - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate); - } -#endif -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -Uint32 SDL_ThreadID(void) -{ - return((Uint32)pthread_self()); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - pthread_join(thread->handle, 0); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ -#ifdef PTHREAD_CANCEL_ASYNCHRONOUS - pthread_cancel(thread->handle); -#else -#ifdef __FreeBSD__ -#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2 -#endif - pthread_kill(thread->handle, SIGKILL); -#endif -} - -#else /* Linux-specific clone() based implementation */ - -#include <errno.h> -#include <unistd.h> -#include <sys/wait.h> - - -/* Stack size for child thread */ -#define STACKSIZE 16384*4 /* 16384 is too small */ - -#ifdef __GLIBC__ -#include <sched.h> -#else -/* From <linux/sched.h> */ -#define CLONE_VM 0x00000100 /* set if VM shared */ -#define CLONE_FS 0x00000200 /* set if fs info shared */ -#define CLONE_FILES 0x00000400 /* set if open files shared */ -#define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */ -#define CLONE_PID 0x00001000 /* set if pid shared */ - -/* The infamous "start_thread" function, courtesy Linus Torvalds */ -extern int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); -#endif - -static int RunThread(void *data) -{ - SDL_RunThread(data); - return(0); -} - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - void *stack; - - /* Allocate memory for thread stack */ - stack = SDL_malloc(STACKSIZE); - if ( stack == (void *)0 ) { - SDL_OutOfMemory(); - return(-1); - } - thread->data = stack; - - /* Adjust the stack since it actually grows down */ - stack = (void *) ((char *)stack + STACKSIZE); - - /* Create the thread and go! */ - thread->handle = clone(RunThread, stack, - (CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND), args); - if ( thread->handle < 0 ) { - SDL_free(thread->data); - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - int i; - sigset_t mask; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - sigprocmask(SIG_BLOCK, &mask, 0); -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -Uint32 SDL_ThreadID(void) -{ - return((Uint32)getpid()); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ -#ifdef __WCLONE - errno = 0; - while ( errno != ECHILD ) { - waitpid(thread->handle, 0, __WCLONE); - } -#else - /* Ack, ugly ugly hack -- - wait() doesn't work, waitpid() doesn't work, and ignoring SIG_CHLD - doesn't work .. and the child thread is still a zombie, so kill() - doesn't work. - */ - char command[1024]; - - SDL_snprintf(command, SDL_arraysize(command), - "ps ax|fgrep -v fgrep|fgrep -v '<zombie>'|fgrep %d >/dev/null", - thread->handle); - while ( system(command) == 0 ) - sleep(1); -#endif - SDL_free(thread->data); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - kill(thread->handle, SIGKILL); -} - -#endif /* SDL_USE_PTHREADS */ - -#endif /* FORK_HACK */ diff --git a/src/thread/linux/clone.S b/src/thread/linux/clone.S deleted file mode 100644 index ad15e83f..00000000 --- a/src/thread/linux/clone.S +++ /dev/null @@ -1,181 +0,0 @@ - -/* Taken with thanks from LinuxThreads 0.6 */ - -/* This is no longer necessary with glibc-2.1, which has its own clone() */ -#ifdef linux -/* Look to see if glibc is available, and if so, what version */ -#include <features.h> - -#if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) -#define HAVE_CLONE -#endif /* glibc 2.1 or newer */ -#endif /* linux */ - -#if defined(linux) && !defined(SDL_USE_PTHREADS) && !defined(HAVE_CLONE) - -#if defined(__i386__) -/************************************************************************/ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Richard Henderson (rth@tamu.edu) - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* clone() is even more special than fork() as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <asm/errno.h> -#include <asm/unistd.h> - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - - .text - .align 4 - .globl __clone - .type __clone,@function - .weak clone - clone = __clone -__clone: - /* Sanity check arguments. */ - movl $-EINVAL,%eax - movl 4(%esp),%ecx /* no NULL function pointers */ - testl %ecx,%ecx - jz syscall_error - movl 8(%esp),%ecx /* no NULL stack pointers */ - testl %ecx,%ecx - jz syscall_error - - /* Insert the argument onto the new stack. */ - subl $8,%ecx - movl 16(%esp),%eax - movl %eax,4(%ecx) - - /* Save the function pointer as the zeroth argument. */ - /* It will be popped off in the child in the ebx frobbing below. */ - movl 4(%esp),%eax - movl %eax,0(%ecx) - - /* Do the system call */ - pushl %ebx - movl 16(%esp),%ebx - movl $__NR_clone,%eax - int $0x80 - popl %ebx - - test %eax,%eax - jl syscall_error - jz thread_start - - ret - -syscall_error: - negl %eax - pushl %eax -#ifdef __PIC__ - call __errno_location@PLT -#else - call __errno_location -#endif - popl 0(%eax) - movl $-1, %eax - ret - -thread_start: - subl %ebp,%ebp /* terminate the stack frame */ - call *%ebx - pushl %eax -#ifdef __PIC__ - call _exit@PLT -#else - call _exit -#endif -/************************************************************************/ -#elif defined(sparc) -/************************************************************************/ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx) - Based on code written for the Intel by Richard - Henderson (rth@tamu.edu) - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* clone() is even more special than fork() as it mucks with stacks - and invokes a function in the right context after its all over. */ - -#include <asm/errno.h> -#include <asm/unistd.h> - -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - - .text - .align 4 - .globl __clone - .type __clone,@function - .weak clone - clone = __clone -__clone: - save %sp,-96,%sp - /* sanity check arguments */ - tst %i0 - be __clone_syscall_error - tst %i1 - be __clone_syscall_error - nop - - /* Do the system call */ - mov %i1,%o1 - mov %i2,%o0 - set __NR_clone,%g1 - ta 0x10 - bcs __clone_syscall_error - tst %o1 - bne __thread_start - nop - mov %o0,%i0 - ret - restore - -__clone_syscall_error: - call __errno_location - set EINVAL,%i0 - st %i0,[%o0] - mov -1,%i0 - ret - restore - -__thread_start: - call %i0 - mov %i3,%o0 - call _exit,0 - nop -/************************************************************************/ -#else -#error "Unknown Linux architecture" -#endif - -#endif /* Linux && ! SDL_USE_PTHREADS */ diff --git a/src/thread/os2/SDL_systhread.c b/src/thread/os2/SDL_systhread.c index d1120f3d..34fe286b 100644 --- a/src/thread/os2/SDL_systhread.c +++ b/src/thread/os2/SDL_systhread.c @@ -28,7 +28,7 @@ #include <os2.h> #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" typedef struct ThreadStartParms { diff --git a/src/thread/pth/SDL_syscond.c b/src/thread/pth/SDL_syscond.c index c003202e..899f8f56 100644 --- a/src/thread/pth/SDL_syscond.c +++ b/src/thread/pth/SDL_syscond.c @@ -7,9 +7,13 @@ #include <pth.h> #include "SDL_thread.h" -#include "SDL_syscond_c.h" #include "SDL_sysmutex_c.h" +struct SDL_cond +{ + pth_cond_t condpth_p; +}; + /* Create a condition variable */ SDL_cond * SDL_CreateCond(void) { diff --git a/src/thread/pth/SDL_syscond_c.h b/src/thread/pth/SDL_syscond_c.h deleted file mode 100644 index 30ed5c5d..00000000 --- a/src/thread/pth/SDL_syscond_c.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _SDL_SYSCOND_C_H_ -#define _SDL_SYSCOND_C_H_ - -struct SDL_cond -{ - pth_cond_t condpth_p; -}; - -#endif /* _SDL_SYSCOND_C_H_ */ diff --git a/src/thread/pth/SDL_systhread.c b/src/thread/pth/SDL_systhread.c index 643e800c..b05ad4d5 100644 --- a/src/thread/pth/SDL_systhread.c +++ b/src/thread/pth/SDL_systhread.c @@ -27,10 +27,10 @@ */ #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" -#include <signal.h> #include <pth.h> +#include <signal.h> /* List of signals to mask in the subthreads */ static int sig_list[] = { @@ -91,7 +91,7 @@ Uint32 SDL_ThreadID(void) void SDL_SYS_WaitThread(SDL_Thread *thread) { - pth_join(thread->handle, 0); + pth_join(thread->handle, NULL); } void SDL_SYS_KillThread(SDL_Thread *thread) diff --git a/src/thread/linux/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index 8c82a33b..0c192b23 100644 --- a/src/thread/linux/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -20,23 +20,6 @@ slouken@libsdl.org */ -#ifdef linux -/* Look to see if glibc is available, and if so, what version */ -#include <features.h> - -#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) -#warning Working around a bug in glibc 2.0 pthreads -#undef SDL_USE_PTHREADS -/* The bug is actually a problem where threads are suspended, but don't - wake up when the thread manager sends them a signal. This is a problem - with thread creation too, but it happens less often. :-/ - We avoid this by using System V IPC for mutexes. - */ -#endif /* glibc 2.0 */ -#endif /* linux */ - -#ifdef SDL_USE_PTHREADS - #include <sys/time.h> #include <unistd.h> #include <errno.h> @@ -45,11 +28,6 @@ #include "SDL_thread.h" #include "SDL_sysmutex_c.h" - -#if defined(PTHREAD_NO_RECURSIVE_MUTEX) && !defined(__bsdi__) -#error You need to use the generic condition variable implementation -#endif - struct SDL_cond { pthread_cond_t cond; @@ -174,9 +152,3 @@ int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) } return retval; } - -#else /* Use semaphore implementation */ - -#include "generic/SDL_syscond.c" - -#endif /* SDL_USE_PTHREADS */ diff --git a/src/thread/linux/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index 2fcae6d7..3249325c 100644 --- a/src/thread/linux/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -20,31 +20,18 @@ slouken@libsdl.org */ -#ifdef linux -/* Look to see if glibc is available, and if so, what version */ -#include <features.h> - -#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) -#warning Working around a bug in glibc 2.0 pthreads -#undef SDL_USE_PTHREADS -/* The bug is actually a problem where threads are suspended, but don't - wake up when the thread manager sends them a signal. This is a problem - with thread creation too, but it happens less often. :-/ - We avoid this by using System V IPC for mutexes. - */ -#endif /* glibc 2.0 */ -#endif /* linux */ - -#ifdef SDL_USE_PTHREADS - #include <pthread.h> #include "SDL_thread.h" +#if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \ + !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#define FAKE_RECURSIVE_MUTEX +#endif struct SDL_mutex { pthread_mutex_t id; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if FAKE_RECURSIVE_MUTEX int recursive; pthread_t owner; #endif @@ -59,13 +46,13 @@ SDL_mutex *SDL_CreateMutex (void) mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); if ( mutex ) { pthread_mutexattr_init(&attr); -#if defined(PTHREAD_RECURSIVE_MUTEX) +#if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); -#elif defined(PTHREAD_RECURSIVE_MUTEX_NP) +#elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); #else /* No extra attributes necessary */ -#endif /* PTHREAD_RECURSIVE_MUTEX */ +#endif if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { SDL_SetError("pthread_mutex_init() failed"); SDL_free(mutex); @@ -89,7 +76,7 @@ void SDL_DestroyMutex(SDL_mutex *mutex) int SDL_mutexP(SDL_mutex *mutex) { int retval; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if FAKE_RECURSIVE_MUTEX pthread_t this_thread; #endif @@ -99,7 +86,7 @@ int SDL_mutexP(SDL_mutex *mutex) } retval = 0; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if FAKE_RECURSIVE_MUTEX this_thread = pthread_self(); if ( mutex->owner == this_thread ) { ++mutex->recursive; @@ -135,7 +122,7 @@ int SDL_mutexV(SDL_mutex *mutex) } retval = 0; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if FAKE_RECURSIVE_MUTEX /* We can only unlock the mutex if we own it */ if ( pthread_self() == mutex->owner ) { if ( mutex->recursive ) { @@ -159,13 +146,7 @@ int SDL_mutexV(SDL_mutex *mutex) SDL_SetError("pthread_mutex_unlock() failed"); retval = -1; } -#endif /* PTHREAD_NO_RECURSIVE_MUTEX */ +#endif /* FAKE_RECURSIVE_MUTEX */ return retval; } - -#else /* Use semaphore implementation */ - -#include "generic/SDL_sysmutex.c" - -#endif /* SDL_USE_PTHREADS */ diff --git a/src/thread/linux/SDL_sysmutex_c.h b/src/thread/pthread/SDL_sysmutex_c.h index 5c2d7002..dd476077 100644 --- a/src/thread/linux/SDL_sysmutex_c.h +++ b/src/thread/pthread/SDL_sysmutex_c.h @@ -23,16 +23,8 @@ #ifndef _SDL_mutex_c_h #define _SDL_mutex_c_h -#ifdef SDL_USE_PTHREADS -/* Recursive mutexes aren't widespread among pthread implementations yet */ -#if 0 -#define PTHREAD_NO_RECURSIVE_MUTEX -#endif - struct SDL_mutex { pthread_mutex_t id; }; -#endif /* SDL_USE_PTHREADS */ - #endif /* _SDL_mutex_c_h */ diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c new file mode 100644 index 00000000..2d976cf7 --- /dev/null +++ b/src/thread/pthread/SDL_syssem.c @@ -0,0 +1,174 @@ +/* + 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 +*/ + +#include <pthread.h> +#include <semaphore.h> + +#include "SDL_thread.h" +#include "SDL_timer.h" + +/* Wrapper around POSIX 1003.1b semaphores */ + +#if MACOSX +#define USE_NAMED_SEMAPHORES 1 +#endif /* MACOSX */ + +struct SDL_semaphore { + sem_t *sem; +#if !USE_NAMED_SEMAPHORES + sem_t sem_data; +#endif +}; + +/* Create a semaphore, initialized with value */ +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +{ + SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); + if ( sem ) { +#if USE_NAMED_SEMAPHORES + static int semnum = 0; + char name[32]; + + SDL_snprintf(name, SDL_arraysize(name), "/SDL_sem-%d-%4.4d", getpid(), semnum++); + sem->sem = sem_open(name, O_CREAT, 0600, initial_value); + if ( sem->sem == (sem_t *)SEM_FAILED ) { + SDL_SetError("sem_open(%s) failed", name); + SDL_free(sem); + sem = NULL; + } else { + sem_unlink(name); + } +#else + if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { + SDL_SetError("sem_init() failed"); + SDL_free(sem); + sem = NULL; + } else { + sem->sem = &sem->sem_data; + } +#endif /* USE_NAMED_SEMAPHORES */ + } else { + SDL_OutOfMemory(); + } + return sem; +} + +void SDL_DestroySemaphore(SDL_sem *sem) +{ + if ( sem ) { +#if USE_NAMED_SEMAPHORES + sem_close(sem->sem); +#else + sem_destroy(sem->sem); +#endif + SDL_free(sem); + } +} + +int SDL_SemTryWait(SDL_sem *sem) +{ + int retval; + + if ( ! sem ) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } + retval = SDL_MUTEX_TIMEDOUT; + if ( sem_trywait(sem->sem) == 0 ) { + retval = 0; + } + return retval; +} + +int SDL_SemWait(SDL_sem *sem) +{ + int retval; + + if ( ! sem ) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } + + retval = sem_wait(sem->sem); + if ( retval < 0 ) { + SDL_SetError("sem_wait() failed"); + } + return retval; +} + +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +{ + int retval; + + if ( ! sem ) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } + + /* Try the easy cases first */ + if ( timeout == 0 ) { + return SDL_SemTryWait(sem); + } + if ( timeout == SDL_MUTEX_MAXWAIT ) { + return SDL_SemWait(sem); + } + + /* Ack! We have to busy wait... */ + timeout += SDL_GetTicks(); + do { + retval = SDL_SemTryWait(sem); + if ( retval == 0 ) { + break; + } + SDL_Delay(1); + } while ( SDL_GetTicks() < timeout ); + + return retval; +} + +Uint32 SDL_SemValue(SDL_sem *sem) +{ + int ret = 0; + if ( sem ) { + sem_getvalue(sem->sem, &ret); + if ( ret < 0 ) { + ret = 0; + } + } + return (Uint32)ret; +} + +int SDL_SemPost(SDL_sem *sem) +{ + int retval; + + if ( ! sem ) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } + + retval = sem_post(sem->sem); + if ( retval < 0 ) { + SDL_SetError("sem_post() failed"); + } + return retval; +} diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c new file mode 100644 index 00000000..aad882d6 --- /dev/null +++ b/src/thread/pthread/SDL_systhread.c @@ -0,0 +1,104 @@ +/* + 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 +*/ + +#include <pthread.h> +#include <signal.h> + +#include "SDL_thread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" + +/* List of signals to mask in the subthreads */ +static int sig_list[] = { + SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, + SIGVTALRM, SIGPROF, 0 +}; + + +static void *RunThread(void *data) +{ + SDL_RunThread(data); + pthread_exit((void*)0); + return((void *)0); /* Prevent compiler warning */ +} + +int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) +{ + pthread_attr_t type; + + /* Set the thread attributes */ + if ( pthread_attr_init(&type) != 0 ) { + SDL_SetError("Couldn't initialize pthread attributes"); + return(-1); + } + pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); + + /* Create the thread and go! */ + if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) { + SDL_SetError("Not enough resources to create thread"); + return(-1); + } + return(0); +} + +void SDL_SYS_SetupThread(void) +{ + int i; + sigset_t mask; + + /* Mask asynchronous signals for this thread */ + sigemptyset(&mask); + for ( i=0; sig_list[i]; ++i ) { + sigaddset(&mask, sig_list[i]); + } + pthread_sigmask(SIG_BLOCK, &mask, 0); + +#ifdef PTHREAD_CANCEL_ASYNCHRONOUS + /* Allow ourselves to be asynchronously cancelled */ + { int oldstate; + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate); + } +#endif +} + +/* WARNING: This may not work for systems with 64-bit pid_t */ +Uint32 SDL_ThreadID(void) +{ + return((Uint32)pthread_self()); +} + +void SDL_SYS_WaitThread(SDL_Thread *thread) +{ + pthread_join(thread->handle, 0); +} + +void SDL_SYS_KillThread(SDL_Thread *thread) +{ +#ifdef PTHREAD_CANCEL_ASYNCHRONOUS + pthread_cancel(thread->handle); +#else +#ifdef __FreeBSD__ +#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2 +#endif + pthread_kill(thread->handle, SIGKILL); +#endif +} diff --git a/src/thread/linux/SDL_systhread_c.h b/src/thread/pthread/SDL_systhread_c.h index e7635b56..b9732ba4 100644 --- a/src/thread/linux/SDL_systhread_c.h +++ b/src/thread/pthread/SDL_systhread_c.h @@ -20,16 +20,6 @@ slouken@libsdl.org */ -#ifdef SDL_USE_PTHREADS - #include <pthread.h> typedef pthread_t SYS_ThreadHandle; - -#else - -#include <sys/types.h> - -typedef pid_t SYS_ThreadHandle; - -#endif /* SDL_USE_PTHREADS */ diff --git a/src/thread/riscos/SDL_syscond.c b/src/thread/riscos/SDL_syscond.c index 9e5aa3a4..609ad222 100644 --- a/src/thread/riscos/SDL_syscond.c +++ b/src/thread/riscos/SDL_syscond.c @@ -22,7 +22,7 @@ /* RISC OS implementations uses pthreads based on linux code */ -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED #include "../generic/SDL_syscond.c" #else #include <sys/time.h> diff --git a/src/thread/riscos/SDL_sysmutex.c b/src/thread/riscos/SDL_sysmutex.c index 6ab50844..06185876 100644 --- a/src/thread/riscos/SDL_sysmutex.c +++ b/src/thread/riscos/SDL_sysmutex.c @@ -22,17 +22,17 @@ /* RISC OS implementations uses pthreads based on linux code */ -#ifdef DISABLE_THREADS +#include "SDL_thread.h" + +#if SDL_THREADS_DISABLED #include "../generic/SDL_sysmutex.c" #else #include <pthread.h> -#include "SDL_thread.h" - struct SDL_mutex { pthread_mutex_t id; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX int recursive; pthread_t owner; #endif @@ -47,11 +47,11 @@ SDL_mutex *SDL_CreateMutex (void) mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); if ( mutex ) { pthread_mutexattr_init(&attr); -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX /* No extra attributes necessary */ #else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); -#endif /* PTHREAD_NO_RECURSIVE_MUTEX */ +#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */ if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { SDL_SetError("pthread_mutex_init() failed"); SDL_free(mutex); @@ -75,7 +75,7 @@ void SDL_DestroyMutex(SDL_mutex *mutex) int SDL_mutexP(SDL_mutex *mutex) { int retval; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX pthread_t this_thread; #endif @@ -85,7 +85,7 @@ int SDL_mutexP(SDL_mutex *mutex) } retval = 0; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX this_thread = pthread_self(); if ( mutex->owner == this_thread ) { ++mutex->recursive; @@ -121,7 +121,7 @@ int SDL_mutexV(SDL_mutex *mutex) } retval = 0; -#ifdef PTHREAD_NO_RECURSIVE_MUTEX +#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX /* We can only unlock the mutex if we own it */ if ( pthread_self() == mutex->owner ) { if ( mutex->recursive ) { @@ -145,7 +145,7 @@ int SDL_mutexV(SDL_mutex *mutex) SDL_SetError("pthread_mutex_unlock() failed"); retval = -1; } -#endif /* PTHREAD_NO_RECURSIVE_MUTEX */ +#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */ return retval; } diff --git a/src/thread/riscos/SDL_sysmutex_c.h b/src/thread/riscos/SDL_sysmutex_c.h index f27d976e..3c4ee296 100644 --- a/src/thread/riscos/SDL_sysmutex_c.h +++ b/src/thread/riscos/SDL_sysmutex_c.h @@ -23,7 +23,7 @@ #ifndef _SDL_mutex_c_h #define _SDL_mutex_c_h -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED struct SDL_mutex { pthread_mutex_t id; }; diff --git a/src/thread/riscos/SDL_syssem.c b/src/thread/riscos/SDL_syssem.c index 54e28385..0210d7a3 100644 --- a/src/thread/riscos/SDL_syssem.c +++ b/src/thread/riscos/SDL_syssem.c @@ -27,7 +27,7 @@ #include "SDL_thread.h" #include "SDL_systhread_c.h" -#ifdef DISABLE_THREADS +#if !SDL_THREADS_DISABLED SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { @@ -196,4 +196,4 @@ int SDL_SemPost(SDL_sem *sem) return retval; } -#endif /* DISABLE_THREADS */ +#endif /* !SDL_THREADS_DISABLED */ diff --git a/src/thread/riscos/SDL_systhread.c b/src/thread/riscos/SDL_systhread.c index 7f0a0649..18f8fe58 100644 --- a/src/thread/riscos/SDL_systhread.c +++ b/src/thread/riscos/SDL_systhread.c @@ -23,9 +23,9 @@ /* RISC OS version based on pthreads linux source */ #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_systhread.h" -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { diff --git a/src/thread/riscos/SDL_systhread_c.h b/src/thread/riscos/SDL_systhread_c.h index 5dbdb745..17de1ff5 100644 --- a/src/thread/riscos/SDL_systhread_c.h +++ b/src/thread/riscos/SDL_systhread_c.h @@ -20,7 +20,7 @@ slouken@libsdl.org */ -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED typedef int SYS_ThreadHandle; diff --git a/src/thread/win32/SDL_systhread.c b/src/thread/win32/SDL_systhread.c index 0b90b418..1da71def 100644 --- a/src/thread/win32/SDL_systhread.c +++ b/src/thread/win32/SDL_systhread.c @@ -25,7 +25,8 @@ #include "SDL_windows.h" #include "SDL_thread.h" -#include "SDL_systhread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" typedef struct ThreadStartParms { diff --git a/src/timer/Makefile.am b/src/timer/Makefile.am deleted file mode 100644 index c549dac4..00000000 --- a/src/timer/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ - -## Makefile.am for the SDL timer library - -noinst_LTLIBRARIES = libtimer.la - -ARCH_SUBDIRS = $(srcdir)/amigaos \ - $(srcdir)/beos \ - $(srcdir)/dc \ - $(srcdir)/epoc \ - $(srcdir)/linux \ - $(srcdir)/macos \ - $(srcdir)/mint \ - $(srcdir)/riscos \ - $(srcdir)/win32 - -# Include the architecture-independent sources -COMMON_SRCS = SDL_timer.c SDL_timer_c.h SDL_systimer.h - -# Include the architecture-specific sources -if TARGET_MINT -ARCH_SRCS = SDL_systimer.c mint/SDL_vbltimer.S mint/SDL_vbltimer_s.h -else -ARCH_SRCS = SDL_systimer.c -endif - -libtimer_la_SOURCES = $(COMMON_SRCS) $(ARCH_SRCS) - -## Let automake know that it shouldn't distribute linked sources -BUILT_SOURCES = $(ARCH_SRCS) - -## Let automake know that it should remove these for distribution -DISTCLEANFILES = $(ARCH_SRCS) - -# The architecture specific directories need to be copied into place -# when building a distribution. -dist-hook: - (cd $(distdir) && rm -f $(BUILT_SOURCES)) - cp -rp $(ARCH_SUBDIRS) $(distdir) - (cd $(distdir) && rm -rf `find . -name CVS`) diff --git a/src/timer/amigaos/SDL_systimer.c b/src/timer/amigaos/SDL_systimer.c index c1190437..6f030fff 100644 --- a/src/timer/amigaos/SDL_systimer.c +++ b/src/timer/amigaos/SDL_systimer.c @@ -49,11 +49,7 @@ extern struct ExecBase *SysBase; static struct GfxBase *GfxBase; #include "SDL_timer.h" -#include "SDL_timer_c.h" - -#if defined(DISABLE_THREADS) || defined(FORK_HACK) -#define USE_ITIMER -#endif +#include "../SDL_timer_c.h" /* The first ticks value of the application */ diff --git a/src/timer/beos/SDL_systimer.c b/src/timer/beos/SDL_systimer.c index 17f5f741..45d9059b 100644 --- a/src/timer/beos/SDL_systimer.c +++ b/src/timer/beos/SDL_systimer.c @@ -24,7 +24,7 @@ #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" static bigtime_t start; diff --git a/src/timer/dc/SDL_systimer.c b/src/timer/dc/SDL_systimer.c index 13bef07c..d4a88803 100644 --- a/src/timer/dc/SDL_systimer.c +++ b/src/timer/dc/SDL_systimer.c @@ -24,7 +24,7 @@ #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" static unsigned start; diff --git a/src/timer/dummy/SDL_systimer.c b/src/timer/dummy/SDL_systimer.c new file mode 100644 index 00000000..a4bc823c --- /dev/null +++ b/src/timer/dummy/SDL_systimer.c @@ -0,0 +1,83 @@ +/* + 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 +*/ + +void SDL_StartTicks(void) +{ +} + +Uint32 SDL_GetTicks (void) +{ + SDL_Unsupported(); + return 0; +} + +void SDL_Delay (Uint32 ms) +{ + SDL_Unsupported(); +} + +#include "SDL_thread.h" + +/* Data to handle a single periodic alarm */ +static int timer_alive = 0; +static SDL_Thread *timer = NULL; + +static int RunTimer(void *unused) +{ + while ( timer_alive ) { + if ( SDL_timer_running ) { + SDL_ThreadedTimerCheck(); + } + SDL_Delay(1); + } + return(0); +} + +/* This is only called if the event thread is not running */ +int SDL_SYS_TimerInit(void) +{ + timer_alive = 1; + timer = SDL_CreateThread(RunTimer, NULL); + if ( timer == NULL ) + return(-1); + return(SDL_SetTimerThreaded(1)); +} + +void SDL_SYS_TimerQuit(void) +{ + timer_alive = 0; + if ( timer ) { + SDL_WaitThread(timer, NULL); + timer = NULL; + } +} + +int SDL_SYS_StartTimer(void) +{ + SDL_SetError("Internal logic error: threaded timer in use"); + return(-1); +} + +void SDL_SYS_StopTimer(void) +{ + return; +} diff --git a/src/timer/epoc/SDL_systimer.cpp b/src/timer/epoc/SDL_systimer.cpp index db40bc8c..1abfe848 100644 --- a/src/timer/epoc/SDL_systimer.cpp +++ b/src/timer/epoc/SDL_systimer.cpp @@ -33,7 +33,7 @@ extern "C" { #include "SDL_error.h" #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" static TUint start = 0; static TInt tickPeriodMilliSeconds; diff --git a/src/timer/macos/SDL_MPWtimer.c b/src/timer/macos/SDL_MPWtimer.c index 57ae013c..a2db6c72 100644 --- a/src/timer/macos/SDL_MPWtimer.c +++ b/src/timer/macos/SDL_MPWtimer.c @@ -29,7 +29,7 @@ #include <LowMem.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" #define MS_PER_TICK (1000/60) /* MacOS tick = 1/60 second */ diff --git a/src/timer/macos/SDL_systimer.c b/src/timer/macos/SDL_systimer.c index e0bfd4d4..345a9ad8 100644 --- a/src/timer/macos/SDL_systimer.c +++ b/src/timer/macos/SDL_systimer.c @@ -29,7 +29,7 @@ #include <LowMem.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" #include "FastTimes.h" diff --git a/src/timer/mint/SDL_systimer.c b/src/timer/mint/SDL_systimer.c index 4f058c35..57f4812d 100644 --- a/src/timer/mint/SDL_systimer.c +++ b/src/timer/mint/SDL_systimer.c @@ -40,7 +40,7 @@ #include <mint/mintbind.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" #include "SDL_thread.h" #include "mint/SDL_vbltimer_s.h" diff --git a/src/timer/os2/SDL_systimer.c b/src/timer/os2/SDL_systimer.c index 25c2978c..0439448b 100644 --- a/src/timer/os2/SDL_systimer.c +++ b/src/timer/os2/SDL_systimer.c @@ -31,7 +31,7 @@ #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" #define TIME_WRAP_VALUE (~(DWORD)0) diff --git a/src/timer/riscos/SDL_systimer.c b/src/timer/riscos/SDL_systimer.c index 15dfc159..f6ab7cf4 100644 --- a/src/timer/riscos/SDL_systimer.c +++ b/src/timer/riscos/SDL_systimer.c @@ -28,10 +28,10 @@ #include <errno.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" -#ifdef DISABLE_THREADS -/* Timer start/reset time */ +#if SDL_THREADS_DISABLED +/* Timer SDL_arraysize(Timer ),start/reset time */ static Uint32 timerStart; /* Timer running function */ void RISCOS_CheckTimer(); @@ -81,7 +81,7 @@ Uint32 SDL_GetTicks (void) void SDL_Delay (Uint32 ms) { Uint32 now,then,elapsed; -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED int is_event_thread; if (riscos_using_threads) { @@ -101,7 +101,7 @@ void SDL_Delay (Uint32 ms) do { /* Do background tasks required while sleeping as we are not multithreaded */ -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED RISCOS_BackgroundTasks(); #else /* For threaded build only run background tasks in event thread */ @@ -116,7 +116,7 @@ void SDL_Delay (Uint32 ms) break; } ms -= elapsed; -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED /* Need to yield to let other threads have a go */ if (riscos_using_threads) pthread_yield(); #endif @@ -124,7 +124,7 @@ void SDL_Delay (Uint32 ms) } while ( 1 ); } -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED /* Non-threaded version of timer */ @@ -225,4 +225,4 @@ void SDL_SYS_StopTimer(void) return; } -#endif /* DISABLE_THREADS */ +#endif /* SDL_THREADS_DISABLED */ diff --git a/src/timer/linux/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index f41e76ed..704c0784 100644 --- a/src/timer/linux/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -18,8 +18,6 @@ Sam Lantinga slouken@libsdl.org - - RDTSC stuff by lompik (lompik@voila.fr) 20/03/2002 */ #include <stdio.h> @@ -29,125 +27,40 @@ #include <string.h> #include <errno.h> +#include "SDL_timer.h" +#include "../SDL_timer_c.h" + /* The clock_gettime provides monotonous time, so we should use it if it's available. The clock_gettime function is behind ifdef for __USE_POSIX199309 Tommi Kyntola (tommi.kyntola@ray.fi) 27/09/2005 */ -#if (defined _POSIX_TIMERS && _POSIX_TIMERS + 0 > 0) +#if HAVE_CLOCK_GETTIME #include <time.h> -/* - * clock_gettime() is missing in my system's glibc, and apparently isn't - * available before Linux kernel 2.6...you can uncomment the following - * define to use it, since it may be a better solution than - * gettimeofday() on systems that support the newer syscall. --ryan. - */ -/*#define USE_CLOCK_GETTIME*/ #endif -#include "SDL_timer.h" -#include "SDL_timer_c.h" - -#if _POSIX_THREAD_SYSCALL_SOFT -#include <pthread.h> -#endif -#ifdef ENABLE_PTH +#if SDL_THREAD_PTH #include <pth.h> +#elif _POSIX_THREAD_SYSCALL_SOFT +#include <pthread.h> #endif -#if defined(DISABLE_THREADS) || defined(FORK_HACK) +#if SDL_THREADS_DISABLED #define USE_ITIMER #endif -/* The following defines should really be determined at configure time */ - -#if defined(linux) -/* Linux select() changes its timeout parameter upon return to contain - the remaining time. Most other unixen leave it unchanged or undefined. */ -#define SELECT_SETS_REMAINING -#elif defined(__bsdi__) || defined(__FreeBSD__) || defined(__sun) || defined(MACOSX) -#define USE_NANOSLEEP -#endif - -#if defined(i386) || defined(__i386__) -/* This only works on pentium or newer x86 processors */ -/* Actually, this isn't reliable on multi-cpu systems, so is disabled */ -/*#define USE_RDTSC*/ -#endif - - -#ifdef USE_RDTSC - /* The first ticks value of the application */ -static unsigned long long start; -static float cpu_mhz1000 = 0.0f; - -#if 1 -/* This is for old binutils version that don't recognize rdtsc mnemonics. - But all binutils version supports this. -*/ -#define rdtsc(t) asm __volatile__ (".byte 0x0f, 0x31; " : "=A" (t)) -#else -#define rdtsc(t) asm __volatile__ ("rdtsc" : "=A" (t)) -#endif - -static float calc_cpu_mhz(void) -{ - float cpu_mhz; - unsigned long long tsc_start; - unsigned long long tsc_end; -/* Slight code doubling here for the sake of readability */ -#ifdef USE_CLOCK_GETTIME - struct timespec tv_start, tv_end; - long usec_delay; - - rdtsc(tsc_start); - clock_gettime(CLOCK_MONOTONIC,&tv_start); - sleep(1); - rdtsc(tsc_end); - clock_gettime(CLOCK_MONOTONIC,&tv_end); - usec_delay = (1000000000L * (tv_end.tv_sec - tv_start.tv_sec) + - (tv_end.tv_nsec - tv_start.tv_nsec)) / 1000; -#else - struct timeval tv_start, tv_end; - long usec_delay; - - rdtsc(tsc_start); - gettimeofday(&tv_start, NULL); - sleep(1); - rdtsc(tsc_end); - gettimeofday(&tv_end, NULL); - usec_delay = 1000000L * (tv_end.tv_sec - tv_start.tv_sec) + - (tv_end.tv_usec - tv_start.tv_usec); -#endif /* USE_CLOCK_GETTIME */ - cpu_mhz = (float)(tsc_end-tsc_start) / usec_delay; -#if 0 - printf("cpu MHz\t\t: %.3f\n", cpu_mhz); -#endif - return cpu_mhz; -} - -#else - -/* The first ticks value of the application */ -#ifdef USE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME static struct timespec start; #else static struct timeval start; -#endif /* USE_CLOCK_GETTIME */ - -#endif /* USE_RDTSC */ +#endif /* HAVE_CLOCK_GETTIME */ void SDL_StartTicks(void) { /* Set first ticks value */ -#ifdef USE_RDTSC - if ( ! cpu_mhz1000 ) { - cpu_mhz1000 = calc_cpu_mhz() * 1000.0f; - } - rdtsc(start); -#elif defined(USE_CLOCK_GETTIME) +#if HAVE_CLOCK_GETTIME clock_gettime(CLOCK_MONOTONIC,&start); #else gettimeofday(&start, NULL); @@ -156,14 +69,7 @@ void SDL_StartTicks(void) Uint32 SDL_GetTicks (void) { -#ifdef USE_RDTSC - unsigned long long now; - if ( ! cpu_mhz1000 ) { - return 0; /* Shouldn't happen. BUG!! */ - } - rdtsc(now); - return (Uint32)((now-start)/cpu_mhz1000); -#elif defined(USE_CLOCK_GETTIME) +#if HAVE_CLOCK_GETTIME Uint32 ticks; struct timespec now; clock_gettime(CLOCK_MONOTONIC,&now); @@ -180,7 +86,7 @@ Uint32 SDL_GetTicks (void) void SDL_Delay (Uint32 ms) { -#ifdef ENABLE_PTH +#if SDL_THREAD_PTH pth_time_t tv; tv.tv_sec = ms/1000; tv.tv_usec = (ms%1000)*1000; @@ -188,20 +94,15 @@ void SDL_Delay (Uint32 ms) #else int was_error; -#ifdef USE_NANOSLEEP +#if HAVE_NANOSLEEP struct timespec elapsed, tv; #else struct timeval tv; -#ifndef SELECT_SETS_REMAINING Uint32 then, now, elapsed; #endif -#endif - /* Set the timeout interval - Linux only needs to do this once */ -#ifdef SELECT_SETS_REMAINING - tv.tv_sec = ms/1000; - tv.tv_usec = (ms%1000)*1000; -#elif defined(USE_NANOSLEEP) + /* Set the timeout interval */ +#if HAVE_NANOSLEEP elapsed.tv_sec = ms/1000; elapsed.tv_nsec = (ms%1000)*1000000; #else @@ -213,12 +114,11 @@ void SDL_Delay (Uint32 ms) #if _POSIX_THREAD_SYSCALL_SOFT pthread_yield_np(); #endif -#ifdef USE_NANOSLEEP +#if HAVE_NANOSLEEP tv.tv_sec = elapsed.tv_sec; tv.tv_nsec = elapsed.tv_nsec; was_error = nanosleep(&tv, &elapsed); #else -#ifndef SELECT_SETS_REMAINING /* Calculate the time interval left (in case of interrupt) */ now = SDL_GetTicks(); elapsed = (now-then); @@ -229,11 +129,11 @@ void SDL_Delay (Uint32 ms) ms -= elapsed; tv.tv_sec = ms/1000; tv.tv_usec = (ms%1000)*1000; -#endif + was_error = select(0, NULL, NULL, NULL, &tv); -#endif /* USE_NANOSLEEP */ +#endif /* HAVE_NANOSLEEP */ } while ( was_error && (errno == EINTR) ); -#endif /* ENABLE_PTH */ +#endif /* SDL_THREAD_PTH */ } #ifdef USE_ITIMER diff --git a/src/timer/win32/SDL_systimer.c b/src/timer/win32/SDL_systimer.c index 19463272..c236487c 100644 --- a/src/timer/win32/SDL_systimer.c +++ b/src/timer/win32/SDL_systimer.c @@ -24,7 +24,7 @@ #include <mmsystem.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" #ifdef _WIN32_WCE #error This is WinCE. Please use src/timer/wince/SDL_systimer.c instead. diff --git a/src/timer/wince/SDL_systimer.c b/src/timer/wince/SDL_systimer.c index a28f5957..5c39ea0a 100644 --- a/src/timer/wince/SDL_systimer.c +++ b/src/timer/wince/SDL_systimer.c @@ -24,7 +24,7 @@ #include <mmsystem.h> #include "SDL_timer.h" -#include "SDL_timer_c.h" +#include "../SDL_timer_c.h" static Uint64 start_date; static Uint64 start_ticks; diff --git a/src/video/Makefile.am b/src/video/Makefile.am deleted file mode 100644 index f01e2f45..00000000 --- a/src/video/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ - -## Makefile.am for the SDL video library - -noinst_LTLIBRARIES = libvideo.la - -# Define which subdirectories need to be built -SUBDIRS = @VIDEO_SUBDIRS@ -DIST_SUBDIRS = dummy x11 dga nanox fbcon directfb vgl svga ggi aalib \ - wincommon windib windx5 \ - maccommon macdsp macrom riscos quartz \ - bwindow ps2gs photon cybergfx epoc picogui \ - ataricommon xbios gem dc qtopia Xext wscons gapi \ - ipod os2fslib - -DRIVERS = @VIDEO_DRIVERS@ - -# Include the architecture-independent sources -COMMON_SRCS = \ - SDL_RLEaccel.c \ - SDL_RLEaccel_c.h \ - SDL_blit.c \ - SDL_blit.h \ - SDL_blit_0.c \ - SDL_blit_1.c \ - SDL_blit_A.c \ - SDL_blit_N.c \ - SDL_bmp.c \ - SDL_cursor.c \ - SDL_cursor_c.h \ - SDL_gamma.c \ - SDL_glfuncs.h \ - SDL_leaks.h \ - SDL_pixels.c \ - SDL_pixels_c.h \ - SDL_surface.c \ - SDL_stretch.c \ - SDL_stretch_c.h \ - SDL_sysvideo.h \ - SDL_video.c \ - SDL_yuv.c \ - SDL_yuvfuncs.h \ - SDL_yuv_sw.c \ - SDL_yuv_sw_c.h \ - SDL_yuv_mmx.c \ - mmx.h \ - math_private.h \ - e_log.h \ - e_pow.h \ - e_sqrt.h \ - blank_cursor.h \ - default_cursor.h - -libvideo_la_SOURCES = $(COMMON_SRCS) -libvideo_la_LIBADD = $(DRIVERS) -libvideo_la_DEPENDENCIES = $(DRIVERS) diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 7f181bbd..95f32598 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -90,7 +90,7 @@ #include "SDL_blit.h" #include "SDL_RLEaccel_c.h" -#if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT) +#if (i386 || __x86_64__) && __GNUC__ && SDL_ASSEMBLY_BLITTERS #define MMX_ASMBLIT #endif diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index 093d8dbb..eaa432d0 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -26,7 +26,7 @@ #include "SDL_RLEaccel_c.h" #include "SDL_pixels_c.h" -#if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT) +#if (i386 || __x86_64__) && __GNUC__ && SDL_ASSEMBLY_BLITTERS #define MMX_ASMBLIT #endif diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index b7da68fb..7b8e0b8f 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -23,13 +23,13 @@ #include "SDL_video.h" #include "SDL_blit.h" -#if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT) -#define MMX_ASMBLIT +#if (defined(i386) || defined(__x86_64__)) && __GNUC__ && SDL_ASSEMBLY_BLITTERS +#define MMX_ASMBLIT 1 #endif /* Function to check the CPU flags */ #include "SDL_cpuinfo.h" -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT #include "mmx.h" #endif @@ -197,7 +197,7 @@ static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) } } -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) { @@ -413,8 +413,8 @@ static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) } #endif -#ifdef USE_ALTIVEC_BLITTERS -#ifdef HAVE_ALTIVEC_H +#if SDL_ALTIVEC_BLITTERS +#if HAVE_ALTIVEC_H #include <altivec.h> #endif #include <assert.h> @@ -1183,7 +1183,7 @@ static void BlitRGBtoRGBSurfaceAlphaAltivec(SDL_BlitInfo *info) dstp += dstskip; } } -#endif /* USE_ALTIVEC_BLITTERS */ +#endif /* SDL_ALTIVEC_BLITTERS */ /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) @@ -1325,7 +1325,7 @@ static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) } } -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT /* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */ inline static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) { @@ -1527,7 +1527,7 @@ static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) } } -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT /* fast RGB565->RGB565 blending with surface alpha */ static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) { @@ -2136,7 +2136,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) if(df->BytesPerPixel == 1) return BlitNto1SurfaceAlphaKey; else -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return Blit32to32SurfaceAlphaKeyAltivec; @@ -2153,7 +2153,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) if(surface->map->identity) { if(df->Gmask == 0x7e0) { -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT if(SDL_HasMMX()) return Blit565to565SurfaceAlphaMMX; else @@ -2162,7 +2162,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) } else if(df->Gmask == 0x3e0) { -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT if(SDL_HasMMX()) return Blit555to555SurfaceAlphaMMX; else @@ -2179,12 +2179,12 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) && (sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff && sf->BytesPerPixel == 4) { -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT if(SDL_HasMMX()) return BlitRGBtoRGBSurfaceAlphaMMX; else #endif -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if(!(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return BlitRGBtoRGBSurfaceAlphaAltivec; else @@ -2192,7 +2192,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) return BlitRGBtoRGBSurfaceAlpha; } else -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if((sf->BytesPerPixel == 4) && !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return Blit32to32SurfaceAlphaAltivec; @@ -2212,7 +2212,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) return BlitNto1PixelAlpha; case 2: -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if(sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) && df->Gmask == 0x7e0 && df->Bmask == 0x1f && SDL_HasAltiVec()) @@ -2237,7 +2237,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { -#ifdef MMX_ASMBLIT +#if MMX_ASMBLIT if(SDL_Has3DNow()) return BlitRGBtoRGBPixelAlphaMMX3DNOW; else @@ -2245,14 +2245,14 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) return BlitRGBtoRGBPixelAlphaMMX; else #endif -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if(!(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return BlitRGBtoRGBPixelAlphaAltivec; else #endif return BlitRGBtoRGBPixelAlpha; } -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if (sf->Amask && sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return Blit32to32PixelAlphaAltivec; diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index c114c6de..b7f2de20 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -27,7 +27,7 @@ /* Functions to blit from N-bit surfaces to other surfaces */ -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS #ifdef HAVE_ALTIVEC_H #include <altivec.h> #endif @@ -842,7 +842,7 @@ static Uint32 GetBlitFeatures( void ) #define LO 1 #endif -#ifdef USE_ASMBLIT +#if SDL_HERMES_BLITTERS /* Heheheh, we coerce Hermes into using SDL blit information */ #define X86_ASSEMBLER @@ -850,8 +850,8 @@ static Uint32 GetBlitFeatures( void ) #define HermesClearInterface void #define STACKCALL -#include "HeadMMX.h" -#include "HeadX86.h" +#include "../hermes/HeadMMX.h" +#include "../hermes/HeadX86.h" #else @@ -1200,7 +1200,7 @@ static void Blit_RGB888_RGB565(SDL_BlitInfo *info) #endif /* USE_DUFFS_LOOP */ } -#endif /* USE_ASMBLIT */ +#endif /* SDL_HERMES_BLITTERS */ /* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */ @@ -2272,15 +2272,14 @@ static const struct blit_table normal_blit_1[] = { { 0,0,0, 0, 0,0,0, 0, NULL, NULL }, }; static const struct blit_table normal_blit_2[] = { -#ifdef USE_ASMBLIT +#if SDL_HERMES_BLITTERS { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800, 0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA }, { 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F, 0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA }, { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00, 0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA }, -#endif -#ifdef USE_ALTIVEC_BLITTERS +#elif SDL_ALTIVEC_BLITTERS /* has-altivec */ { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000, 2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, @@ -2304,7 +2303,7 @@ static const struct blit_table normal_blit_3[] = { { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } }; static const struct blit_table normal_blit_4[] = { -#ifdef USE_ASMBLIT +#if SDL_HERMES_BLITTERS { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, 1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA }, { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, @@ -2332,7 +2331,7 @@ static const struct blit_table normal_blit_4[] = { { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000, 0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA }, #else -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS /* has-altivec | dont-use-prefetch */ { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000, 6, NULL, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, @@ -2393,7 +2392,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index) else if(dstfmt->BytesPerPixel == 1) return BlitNto1Key; else { -#ifdef USE_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS if((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) { return Blit32to32KeyAltivec; } else @@ -2416,7 +2415,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index) if ( surface->map->table ) { blitfun = Blit_RGB888_index8_map; } else { -#ifdef USE_ASMBLIT +#if SDL_HERMES_BLITTERS sdata->aux_data = ConvertX86p32_8RGB332; blitfun = ConvertX86; #else @@ -2461,7 +2460,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index) } #ifdef DEBUG_ASM -#ifdef USE_ASMBLIT +#if SDL_HERMES_BLITTERS if ( blitfun == ConvertMMX ) fprintf(stderr, "Using mmx blit\n"); else diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index aa606bfb..bcd72cc2 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -20,8 +20,6 @@ slouken@libsdl.org */ -#ifndef DISABLE_FILE - /* Code to load and save surfaces in Windows BMP format. @@ -519,5 +517,3 @@ int SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst) } return((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1); } - -#endif /* ENABLE_FILE */ diff --git a/src/video/SDL_cursor.c b/src/video/SDL_cursor.c index 14bdc9a2..209ba107 100644 --- a/src/video/SDL_cursor.c +++ b/src/video/SDL_cursor.c @@ -26,12 +26,12 @@ #include "SDL_video.h" #include "SDL_mouse.h" #include "SDL_blit.h" -#include "SDL_events_c.h" #include "SDL_sysvideo.h" -#include "SDL_sysevents.h" #include "SDL_cursor_c.h" #include "SDL_pixels_c.h" #include "default_cursor.h" +#include "../events/SDL_sysevents.h" +#include "../events/SDL_events_c.h" /* These are static for our cursor handling code */ volatile int SDL_cursorstate = CURSOR_VISIBLE; diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 7499c858..026d1b4e 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -33,15 +33,14 @@ into the general blitting mechanism. */ -#if (defined(WIN32) && !defined(_M_ALPHA) && !defined(_WIN32_WCE) && \ - !defined(__WATCOMC__) && !defined(__LCC__) && !defined(__FREEBCC__)) || \ - (defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)) +#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \ + (defined(i386) && defined(__GNUC__))) && SDL_ASSEMBLY_BLITTERS #define USE_ASM_STRETCH #endif #ifdef USE_ASM_STRETCH -#if defined(WIN32) || defined(i386) +#if defined(_M_IX86) || defined(i386) #define PREFIX16 0x66 #define STORE_BYTE 0xAA #define STORE_WORD 0xAB @@ -282,7 +281,7 @@ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, : "0" (dstp), "1" (srcp), "r" (copy_row) : "memory" ); #else -#ifdef WIN32 +#ifdef _MSC_VER { void *code = copy_row; __asm { push edi diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index ae4d4caa..9d406db3 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -34,19 +34,16 @@ /* OpenGL is pretty much available on all Windows systems */ #ifdef WIN32 -#ifndef _WIN32_WCE -#define HAVE_OPENGL -#endif #include "SDL_windows.h" #endif -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #ifdef MACOSX #include <OpenGL/gl.h> /* OpenGL.framework */ #else #include <GL/gl.h> #endif /* MACOSX */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ /* The SDL video driver */ typedef struct SDL_VideoDevice SDL_VideoDevice; @@ -194,7 +191,7 @@ struct SDL_VideoDevice { void (*GL_SwapBuffers)(_THIS); /* OpenGL functions for SDL_OPENGLBLIT */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #ifndef WIN32 #define WINAPI #endif @@ -326,103 +323,97 @@ typedef struct VideoBootStrap { SDL_VideoDevice *(*create)(int devindex); } VideoBootStrap; -#ifdef ENABLE_X11 +#if SDL_VIDEO_DRIVER_QUARTZ +extern VideoBootStrap QZ_bootstrap; +#endif +#if SDL_VIDEO_DRIVER_X11 extern VideoBootStrap X11_bootstrap; #endif -#ifdef ENABLE_DGA +#if SDL_VIDEO_DRIVER_DGA extern VideoBootStrap DGA_bootstrap; #endif -#ifdef ENABLE_NANOX +#if SDL_VIDEO_DRIVER_NANOX extern VideoBootStrap NX_bootstrap; #endif -#ifdef ENABLE_IPOD +#if SDL_VIDEO_DRIVER_IPOD extern VideoBootStrap iPod_bootstrap; #endif -#ifdef ENABLE_FBCON +#if SDL_VIDEO_DRIVER_QTOPIA +extern VideoBootStrap Qtopia_bootstrap; +#endif +#if SDL_VIDEO_DRIVER_WSCONS +extern VideoBootStrap WSCONS_bootstrap; +#endif +#if SDL_VIDEO_DRIVER_FBCON extern VideoBootStrap FBCON_bootstrap; #endif -#ifdef ENABLE_DIRECTFB +#if SDL_VIDEO_DRIVER_DIRECTFB extern VideoBootStrap DirectFB_bootstrap; #endif -#ifdef ENABLE_PS2GS +#if SDL_VIDEO_DRIVER_PS2GS extern VideoBootStrap PS2GS_bootstrap; #endif -#ifdef ENABLE_GGI +#if SDL_VIDEO_DRIVER_GGI extern VideoBootStrap GGI_bootstrap; #endif -#ifdef ENABLE_VGL +#if SDL_VIDEO_DRIVER_VGL extern VideoBootStrap VGL_bootstrap; #endif -#ifdef ENABLE_SVGALIB +#if SDL_VIDEO_DRIVER_SVGALIB extern VideoBootStrap SVGALIB_bootstrap; #endif -#ifdef ENABLE_AALIB -extern VideoBootStrap AALIB_bootstrap; -#endif -#ifdef ENABLE_GAPI +#if SDL_VIDEO_DRIVER_GAPI extern VideoBootStrap GAPI_bootstrap; #endif -#ifdef ENABLE_WINDIB +#if SDL_VIDEO_DRIVER_WINDIB extern VideoBootStrap WINDIB_bootstrap; #endif -#ifdef ENABLE_DIRECTX +#if SDL_VIDEO_DRIVER_DDRAW extern VideoBootStrap DIRECTX_bootstrap; #endif -#ifdef ENABLE_BWINDOW +#if SDL_VIDEO_DRIVER_BWINDOW extern VideoBootStrap BWINDOW_bootstrap; #endif -/* MacOS X gets the proper defines from configure */ -#if defined(macintosh) && !defined(MACOSX) -#define ENABLE_TOOLBOX -#if !TARGET_API_MAC_CARBON -#define ENABLE_DRAWSPROCKET -#endif -#endif -#ifdef ENABLE_TOOLBOX +#if SDL_VIDEO_DRIVER_TOOLBOX extern VideoBootStrap TOOLBOX_bootstrap; #endif -#ifdef ENABLE_DRAWSPROCKET +#if SDL_VIDEO_DRIVER_DRAWSPROCKET extern VideoBootStrap DSp_bootstrap; #endif -#ifdef ENABLE_QUARTZ -extern VideoBootStrap QZ_bootstrap; -#endif -#ifdef ENABLE_CYBERGRAPHICS +#if SDL_VIDEO_DRIVER_CYBERGRAPHICS extern VideoBootStrap CGX_bootstrap; #endif -#ifdef ENABLE_PHOTON +#if SDL_VIDEO_DRIVER_PHOTON extern VideoBootStrap ph_bootstrap; #endif -#ifdef ENABLE_EPOC +#if SDL_VIDEO_DRIVER_EPOC extern VideoBootStrap EPOC_bootstrap; #endif -#ifdef ENABLE_DUMMYVIDEO -extern VideoBootStrap DUMMY_bootstrap; -#endif -#ifdef ENABLE_XBIOS +#if SDL_VIDEO_DRIVER_XBIOS extern VideoBootStrap XBIOS_bootstrap; #endif -#ifdef ENABLE_GEM +#if SDL_VIDEO_DRIVER_GEM extern VideoBootStrap GEM_bootstrap; #endif -#ifdef ENABLE_QTOPIA -extern VideoBootStrap Qtopia_bootstrap; -#endif -#ifdef ENABLE_WSCONS -extern VideoBootStrap WSCONS_bootstrap; -#endif -#ifdef ENABLE_PICOGUI +#if SDL_VIDEO_DRIVER_PICOGUI extern VideoBootStrap PG_bootstrap; #endif -#ifdef ENABLE_DC +#if SDL_VIDEO_DRIVER_DC extern VideoBootStrap DC_bootstrap; #endif -#ifdef ENABLE_RISCOS +#if SDL_VIDEO_DRIVER_RISCOS extern VideoBootStrap RISCOS_bootstrap; #endif -#ifdef __OS2__ +#if SDL_VIDEO_DRIVER_OS2FS extern VideoBootStrap OS2FSLib_bootstrap; #endif +#if SDL_VIDEO_DRIVER_AALIB +extern VideoBootStrap AALIB_bootstrap; +#endif +#if SDL_VIDEO_DRIVER_DUMMY +extern VideoBootStrap DUMMY_bootstrap; +#endif + /* This is the current video device */ extern SDL_VideoDevice *current_video; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 87ced5f2..68d95cbb 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -24,102 +24,102 @@ #include "SDL.h" #include "SDL_sysvideo.h" -#include "SDL_sysevents.h" #include "SDL_blit.h" #include "SDL_pixels_c.h" -#include "SDL_events_c.h" #include "SDL_cursor_c.h" +#include "../events/SDL_sysevents.h" +#include "../events/SDL_events_c.h" /* Available video drivers */ static VideoBootStrap *bootstrap[] = { -#ifdef ENABLE_QUARTZ +#if SDL_VIDEO_DRIVER_QUARTZ &QZ_bootstrap, #endif -#ifdef ENABLE_X11 +#if SDL_VIDEO_DRIVER_X11 &X11_bootstrap, #endif -#ifdef ENABLE_DGA +#if SDL_VIDEO_DRIVER_DGA &DGA_bootstrap, #endif -#ifdef ENABLE_NANOX +#if SDL_VIDEO_DRIVER_NANOX &NX_bootstrap, #endif -#ifdef ENABLE_IPOD +#if SDL_VIDEO_DRIVER_IPOD &iPod_bootstrap, #endif -#ifdef ENABLE_QTOPIA +#if SDL_VIDEO_DRIVER_QTOPIA &Qtopia_bootstrap, #endif -#ifdef ENABLE_WSCONS +#if SDL_VIDEO_DRIVER_WSCONS &WSCONS_bootstrap, #endif -#ifdef ENABLE_FBCON +#if SDL_VIDEO_DRIVER_FBCON &FBCON_bootstrap, #endif -#ifdef ENABLE_DIRECTFB +#if SDL_VIDEO_DRIVER_DIRECTFB &DirectFB_bootstrap, #endif -#ifdef ENABLE_PS2GS +#if SDL_VIDEO_DRIVER_PS2GS &PS2GS_bootstrap, #endif -#ifdef ENABLE_GGI +#if SDL_VIDEO_DRIVER_GGI &GGI_bootstrap, #endif -#ifdef ENABLE_VGL +#if SDL_VIDEO_DRIVER_VGL &VGL_bootstrap, #endif -#ifdef ENABLE_SVGALIB +#if SDL_VIDEO_DRIVER_SVGALIB &SVGALIB_bootstrap, #endif -#ifdef ENABLE_AALIB - &AALIB_bootstrap, -#endif -#ifdef ENABLE_GAPI +#if SDL_VIDEO_DRIVER_GAPI &GAPI_bootstrap, #endif -#ifdef ENABLE_WINDIB +#if SDL_VIDEO_DRIVER_WINDIB &WINDIB_bootstrap, #endif -#ifdef ENABLE_DIRECTX +#if SDL_VIDEO_DRIVER_DDRAW &DIRECTX_bootstrap, #endif -#ifdef ENABLE_BWINDOW +#if SDL_VIDEO_DRIVER_BWINDOW &BWINDOW_bootstrap, #endif -#ifdef ENABLE_TOOLBOX +#if SDL_VIDEO_DRIVER_TOOLBOX &TOOLBOX_bootstrap, #endif -#ifdef ENABLE_DRAWSPROCKET +#if SDL_VIDEO_DRIVER_DRAWSPROCKET &DSp_bootstrap, #endif -#ifdef ENABLE_CYBERGRAPHICS +#if SDL_VIDEO_DRIVER_CYBERGRAPHICS &CGX_bootstrap, #endif -#ifdef ENABLE_PHOTON +#if SDL_VIDEO_DRIVER_PHOTON &ph_bootstrap, #endif -#ifdef ENABLE_EPOC +#if SDL_VIDEO_DRIVER_EPOC &EPOC_bootstrap, #endif -#ifdef ENABLE_XBIOS +#if SDL_VIDEO_DRIVER_XBIOS &XBIOS_bootstrap, #endif -#ifdef ENABLE_GEM +#if SDL_VIDEO_DRIVER_GEM &GEM_bootstrap, #endif -#ifdef ENABLE_PICOGUI +#if SDL_VIDEO_DRIVER_PICOGUI &PG_bootstrap, #endif -#ifdef ENABLE_DC +#if SDL_VIDEO_DRIVER_DC &DC_bootstrap, #endif -#ifdef ENABLE_RISCOS +#if SDL_VIDEO_DRIVER_RISCOS &RISCOS_bootstrap, #endif -#ifdef __OS2__ +#if SDL_VIDEO_DRIVER_OS2FS &OS2FSLib_bootstrap, #endif -#ifdef ENABLE_DUMMYVIDEO +#if SDL_VIDEO_DRIVER_AALIB + &AALIB_bootstrap, +#endif +#if SDL_VIDEO_DRIVER_DUMMY &DUMMY_bootstrap, #endif NULL @@ -133,7 +133,7 @@ void SDL_VideoQuit(void); void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects); static SDL_GrabMode SDL_WM_GrabInputOff(void); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static int lock_count = 0; #endif @@ -743,7 +743,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) SDL_WM_GrabInput(saved_grab); SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Load GL symbols (before MakeCurrent, where we need glGetString). */ if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { @@ -769,7 +769,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) #include "SDL_glfuncs.h" #undef SDL_PROC } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ /* If we're running OpenGL, make the context current */ if ( (video->screen->flags & SDL_OPENGL) && @@ -782,7 +782,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) /* Set up a fake SDL surface for OpenGL "blitting" */ if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) { /* Load GL functions for performing the texture updates */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Create a software surface for blitting */ #ifdef GL_VERSION_1_2 @@ -857,7 +857,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) video->UpdateRects = SDL_GL_UpdateRectsLock; #else - SDL_SetError("Somebody forgot to #define HAVE_OPENGL"); + SDL_SetError("Somebody forgot to #define SDL_VIDEO_OPENGL"); return(NULL); #endif } @@ -1513,7 +1513,7 @@ void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect *rects /* Update rects without state setting and changing (the caller is responsible for it) */ void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL SDL_VideoDevice *this = current_video; SDL_Rect update, tmp; int x, y, i; @@ -1587,7 +1587,7 @@ void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects) /* Lock == save current state */ void SDL_GL_Lock() { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL lock_count--; if (lock_count==-1) { @@ -1635,7 +1635,7 @@ void SDL_GL_Lock() /* Unlock == restore saved state */ void SDL_GL_Unlock() { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL lock_count++; if (lock_count==0) { diff --git a/src/video/SDL_yuv_mmx.c b/src/video/SDL_yuv_mmx.c index 68020962..018d24ff 100644 --- a/src/video/SDL_yuv_mmx.c +++ b/src/video/SDL_yuv_mmx.c @@ -22,7 +22,7 @@ #include "SDL_stdinc.h" -#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) +#if i386 && __GNUC__ && SDL_ASSEMBLY_BLITTERS #define ASM_ARRAY(x) x[] __asm__("_" #x) __attribute__((used)) diff --git a/src/video/SDL_yuv_sw.c b/src/video/SDL_yuv_sw.c index 03d0e6d5..9d814118 100644 --- a/src/video/SDL_yuv_sw.c +++ b/src/video/SDL_yuv_sw.c @@ -1058,7 +1058,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S case SDL_YV12_OVERLAY: case SDL_IYUV_OVERLAY: if ( display->format->BytesPerPixel == 2 ) { -#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) +#if i386 && __GNUC__ && SDL_ASSEMBLY_BLITTERS /* inline assembly functions */ if ( SDL_HasMMX() && (Rmask == 0xF800) && (Gmask == 0x07E0) && @@ -1080,7 +1080,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S swdata->Display2X = Color24DitherYV12Mod2X; } if ( display->format->BytesPerPixel == 4 ) { -#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) +#if i386 && __GNUC__ && SDL_ASSEMBLY_BLITTERS /* inline assembly functions */ if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && (Gmask == 0x0000FF00) && diff --git a/src/video/Xext/Makefile.am b/src/video/Xext/Makefile.am deleted file mode 100644 index 21a7498b..00000000 --- a/src/video/Xext/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ - -SUBDIRS = extensions Xinerama Xv Xxf86dga Xxf86vm XME - -EXTRA_DIST = README diff --git a/src/video/Xext/XME/Makefile.am b/src/video/Xext/XME/Makefile.am deleted file mode 100644 index a7f11936..00000000 --- a/src/video/Xext/XME/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ - -## Makefile.am for the XME library - -noinst_LTLIBRARIES = libXME.la -libXME_la_SOURCES = xme.c - diff --git a/src/video/Xext/XME/xme.c b/src/video/Xext/XME/xme.c index 332b7663..be6869dc 100644 --- a/src/video/Xext/XME/xme.c +++ b/src/video/Xext/XME/xme.c @@ -19,7 +19,7 @@ #include <X11/Xmd.h> #include <X11/Xproto.h> #include <X11/extensions/Xext.h> -#include "extutil.h" +#include "../extensions/extutil.h" #include "../../x11/SDL_x11dyn.h" diff --git a/src/video/Xext/Xinerama/Makefile.am b/src/video/Xext/Xinerama/Makefile.am deleted file mode 100644 index ee58d3d2..00000000 --- a/src/video/Xext/Xinerama/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -## Makefile.am for the XFree86 Xinerama library - -noinst_LTLIBRARIES = libXext_Xinerama.la -libXext_Xinerama_la_SOURCES = Xinerama.c diff --git a/src/video/Xext/Xinerama/Xinerama.c b/src/video/Xext/Xinerama/Xinerama.c index 2aa872d8..dca8adca 100644 --- a/src/video/Xext/Xinerama/Xinerama.c +++ b/src/video/Xext/Xinerama/Xinerama.c @@ -30,10 +30,10 @@ Equipment Corporation. #include <X11/Xlibint.h> #include <X11/Xutil.h> #include <X11/extensions/Xext.h> /* in ../include */ -#include "extutil.h" /* in ../include */ -#include "panoramiXext.h" -#include "panoramiXproto.h" /* in ../include */ -#include "Xinerama.h" +#include "../extensions/extutil.h" /* in ../include */ +#include "../extensions/panoramiXext.h" +#include "../extensions/panoramiXproto.h" /* in ../include */ +#include "../extensions/Xinerama.h" #include "../../x11/SDL_x11dyn.h" diff --git a/src/video/Xext/Xv/Makefile.am b/src/video/Xext/Xv/Makefile.am deleted file mode 100644 index 9db58dce..00000000 --- a/src/video/Xext/Xv/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -## Makefile.am for the XFree86 Xv library - -noinst_LTLIBRARIES = libXext_Xv.la -libXext_Xv_la_SOURCES = Xv.c Xvlibint.h diff --git a/src/video/Xext/Xv/Xv.c b/src/video/Xext/Xv/Xv.c index 7fc6c013..6b7743f7 100644 --- a/src/video/Xext/Xv/Xv.c +++ b/src/video/Xext/Xv/Xv.c @@ -54,7 +54,7 @@ SOFTWARE. #include "Xvlibint.h" #include <X11/extensions/Xext.h> #include <X11/extensions/XShm.h> -#include "extutil.h" +#include "../extensions/extutil.h" #include "../../x11/SDL_x11dyn.h" diff --git a/src/video/Xext/Xv/Xvlibint.h b/src/video/Xext/Xv/Xvlibint.h index 33615a09..9d0cb239 100644 --- a/src/video/Xext/Xv/Xvlibint.h +++ b/src/video/Xext/Xv/Xvlibint.h @@ -44,8 +44,8 @@ SOFTWARE. #define NEED_REPLIES #include <X11/Xlibint.h> -#include "Xvproto.h" -#include "Xvlib.h" +#include "../extensions/Xvproto.h" +#include "../extensions/Xvlib.h" #if !defined(UNIXCPP) #define XvGetReq(name, req) \ diff --git a/src/video/Xext/Xxf86dga/Makefile.am b/src/video/Xext/Xxf86dga/Makefile.am deleted file mode 100644 index 5bc0095e..00000000 --- a/src/video/Xext/Xxf86dga/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -## Makefile.am for the XFree86 Xxf86dga library - -noinst_LTLIBRARIES = libXext_Xxf86dga.la -libXext_Xxf86dga_la_SOURCES = XF86DGA2.c XF86DGA.c diff --git a/src/video/Xext/Xxf86dga/XF86DGA.c b/src/video/Xext/Xxf86dga/XF86DGA.c index 926ddf6b..b3162542 100644 --- a/src/video/Xext/Xxf86dga/XF86DGA.c +++ b/src/video/Xext/Xxf86dga/XF86DGA.c @@ -59,10 +59,10 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc #define NEED_EVENTS #define NEED_REPLIES #include <X11/Xlibint.h> -#include "xf86dga.h" -#include "xf86dgastr.h" +#include "../extensions/xf86dga.h" +#include "../extensions/xf86dgastr.h" #include <X11/extensions/Xext.h> -#include "extutil.h" +#include "../extensions/extutil.h" #include "../../x11/SDL_x11dyn.h" @@ -341,7 +341,7 @@ Bool SDL_NAME(XF86DGAViewPortChanged)( /* Helper functions */ #include <X11/Xmd.h> -#include <Xext/extensions/xf86dga.h> +#include "../extensions/xf86dga.h" #include <stdlib.h> #include <stdio.h> #include <fcntl.h> diff --git a/src/video/Xext/Xxf86dga/XF86DGA2.c b/src/video/Xext/Xxf86dga/XF86DGA2.c index e19742ea..f792242d 100644 --- a/src/video/Xext/Xxf86dga/XF86DGA2.c +++ b/src/video/Xext/Xxf86dga/XF86DGA2.c @@ -17,10 +17,10 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc #define NEED_EVENTS #define NEED_REPLIES #include <X11/Xlibint.h> -#include "xf86dga.h" -#include "xf86dgastr.h" +#include "../extensions/xf86dga.h" +#include "../extensions/xf86dgastr.h" #include <X11/extensions/Xext.h> -#include "extutil.h" +#include "../extensions/extutil.h" #include <stdio.h> #if defined(ENABLE_FBCON) /* Needed for framebuffer console support */ diff --git a/src/video/Xext/Xxf86vm/Makefile.am b/src/video/Xext/Xxf86vm/Makefile.am deleted file mode 100644 index 2a2833e5..00000000 --- a/src/video/Xext/Xxf86vm/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -## Makefile.am for the XFree86 Xxf86vm library - -noinst_LTLIBRARIES = libXext_Xxf86vm.la -libXext_Xxf86vm_la_SOURCES = XF86VMode.c diff --git a/src/video/Xext/Xxf86vm/XF86VMode.c b/src/video/Xext/Xxf86vm/XF86VMode.c index b068ecb8..c81b1f71 100644 --- a/src/video/Xext/Xxf86vm/XF86VMode.c +++ b/src/video/Xext/Xxf86vm/XF86VMode.c @@ -37,9 +37,9 @@ from Kaleb S. KEITHLEY. #define NEED_REPLIES #ifndef XBUILD_IN_CLIENT #include <X11/Xlibint.h> -#include "xf86vmstr.h" +#include "../extensions/xf86vmstr.h" #include <X11/extensions/Xext.h> -#include "extutil.h" +#include "../extensions/extutil.h" #else #include "lib/X11/Xlibint.h" #include "include/extensions/xf86vmstr.h" diff --git a/src/video/Xext/extensions/Makefile.am b/src/video/Xext/extensions/Makefile.am deleted file mode 100644 index eae168ee..00000000 --- a/src/video/Xext/extensions/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -noinst_HEADERS = \ - extutil.h \ - panoramiXext.h \ - panoramiXproto.h \ - xf86dga1.h \ - xf86dga1str.h \ - xf86dga.h \ - xf86dgastr.h \ - xf86vmode.h \ - xf86vmstr.h \ - Xinerama.h \ - Xv.h \ - Xvlib.h \ - Xvproto.h \ - xme.h - diff --git a/src/video/Xext/extensions/Xvlib.h b/src/video/Xext/extensions/Xvlib.h index dcbd8d71..0d0a55da 100644 --- a/src/video/Xext/extensions/Xvlib.h +++ b/src/video/Xext/extensions/Xvlib.h @@ -54,7 +54,7 @@ SOFTWARE. */ #include <X11/Xfuncproto.h> -#include <Xext/extensions/Xv.h> +#include "Xv.h" #include "SDL_name.h" typedef struct { diff --git a/src/video/Xext/extensions/xf86dga.h b/src/video/Xext/extensions/xf86dga.h index b169c943..c71ef4b1 100644 --- a/src/video/Xext/extensions/xf86dga.h +++ b/src/video/Xext/extensions/xf86dga.h @@ -7,7 +7,7 @@ #define _XF86DGA_H_ #include <X11/Xfuncproto.h> -#include <Xext/extensions/xf86dga1.h> +#include "xf86dga1.h" #include "SDL_name.h" #define X_XDGAQueryVersion 0 diff --git a/src/video/Xext/extensions/xf86dgastr.h b/src/video/Xext/extensions/xf86dgastr.h index 487daf08..b249feb3 100644 --- a/src/video/Xext/extensions/xf86dgastr.h +++ b/src/video/Xext/extensions/xf86dgastr.h @@ -9,7 +9,7 @@ Copyright (c) 1995 XFree86 Inc. #ifndef _XF86DGASTR_H_ #define _XF86DGASTR_H_ -#include <Xext/extensions/xf86dga1str.h> +#include "xf86dga1str.h" #define XF86DGANAME "XFree86-DGA" diff --git a/src/video/Xext/extensions/xf86vmstr.h b/src/video/Xext/extensions/xf86vmstr.h index 481395c6..0c3078d5 100644 --- a/src/video/Xext/extensions/xf86vmstr.h +++ b/src/video/Xext/extensions/xf86vmstr.h @@ -35,7 +35,7 @@ from Kaleb S. KEITHLEY #ifndef _XF86VIDMODESTR_H_ #define _XF86VIDMODESTR_H_ -#include <Xext/extensions/xf86vmode.h> +#include "xf86vmode.h" #define XF86VIDMODENAME "XFree86-VidModeExtension" diff --git a/src/video/aalib/Makefile.am b/src/video/aalib/Makefile.am deleted file mode 100644 index da49404f..00000000 --- a/src/video/aalib/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for SDL using the AAlib video driver - -noinst_LTLIBRARIES = libvideo_aa.la -libvideo_aa_la_SOURCES = $(AA_SRCS) - -# The SDL AAlib video driver sources -AA_SRCS = \ - SDL_aavideo.h \ - SDL_aaevents.c \ - SDL_aaevents_c.h \ - SDL_aamouse.c \ - SDL_aamouse_c.h \ - SDL_aavideo.c - diff --git a/src/video/aalib/SDL_aaevents.c b/src/video/aalib/SDL_aaevents.c index 18cd3d70..d02de8c1 100644 --- a/src/video/aalib/SDL_aaevents.c +++ b/src/video/aalib/SDL_aaevents.c @@ -27,8 +27,8 @@ #include <aalib.h> #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_aavideo.h" #include "SDL_aaevents_c.h" diff --git a/src/video/aalib/SDL_aamouse.c b/src/video/aalib/SDL_aamouse.c index 3caffc35..59d89092 100644 --- a/src/video/aalib/SDL_aamouse.c +++ b/src/video/aalib/SDL_aamouse.c @@ -23,7 +23,7 @@ #include <stdio.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_aamouse_c.h" diff --git a/src/video/aalib/SDL_aavideo.c b/src/video/aalib/SDL_aavideo.c index cd315e89..63faf2eb 100644 --- a/src/video/aalib/SDL_aavideo.c +++ b/src/video/aalib/SDL_aavideo.c @@ -29,9 +29,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_aavideo.h" #include "SDL_aaevents_c.h" diff --git a/src/video/aalib/SDL_aavideo.h b/src/video/aalib/SDL_aavideo.h index ca8bd2b2..4ac8e746 100644 --- a/src/video/aalib/SDL_aavideo.h +++ b/src/video/aalib/SDL_aavideo.h @@ -24,8 +24,8 @@ #define _SDL_aavideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" #include <aalib.h> diff --git a/src/video/ataricommon/Makefile.am b/src/video/ataricommon/Makefile.am deleted file mode 100644 index f01fd6e2..00000000 --- a/src/video/ataricommon/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ - -## Makefile.am for SDL using the Atari bios - -noinst_LTLIBRARIES = libvideo_ataricommon.la -libvideo_ataricommon_la_SOURCES = $(ATARICOMMON_SRCS) - -# The SDL Atari bios driver sources -ATARICOMMON_SRCS = \ - SDL_ataric2p.S \ - SDL_ataric2p_s.h \ - SDL_atarieddi.S \ - SDL_atarieddi_s.h \ - SDL_atarievents.c \ - SDL_atarievents_c.h \ - SDL_atarigl.c \ - SDL_atarigl_c.h \ - SDL_atarikeys.h \ - SDL_atarimxalloc.c \ - SDL_atarimxalloc_c.h \ - SDL_biosevents.c \ - SDL_biosevents_c.h \ - SDL_gemdosevents.c \ - SDL_gemdosevents_c.h \ - SDL_ikbdevents.c \ - SDL_ikbdevents_c.h \ - SDL_ikbdinterrupt.S \ - SDL_ikbdinterrupt_s.h \ - SDL_xbiosevents.c \ - SDL_xbiosevents_c.h \ - SDL_xbiosinterrupt.S \ - SDL_xbiosinterrupt_s.h diff --git a/src/video/ataricommon/SDL_atarievents.c b/src/video/ataricommon/SDL_atarievents.c index 721ad6e4..b655d848 100644 --- a/src/video/ataricommon/SDL_atarievents.c +++ b/src/video/ataricommon/SDL_atarievents.c @@ -30,8 +30,8 @@ #include <mint/cookie.h> -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_atarievents_c.h" #include "SDL_biosevents_c.h" diff --git a/src/video/ataricommon/SDL_atarievents_c.h b/src/video/ataricommon/SDL_atarievents_c.h index b64faab9..2301863a 100644 --- a/src/video/ataricommon/SDL_atarievents_c.h +++ b/src/video/ataricommon/SDL_atarievents_c.h @@ -29,7 +29,7 @@ #ifndef _SDL_ATARI_EVENTS_H_ #define _SDL_ATARI_EVENTS_H_ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ataricommon/SDL_atarigl.c b/src/video/ataricommon/SDL_atarigl.c index 368e41db..fb416f9e 100644 --- a/src/video/ataricommon/SDL_atarigl.c +++ b/src/video/ataricommon/SDL_atarigl.c @@ -24,7 +24,7 @@ /*--- Includes ---*/ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #include <GL/osmesa.h> #endif @@ -33,7 +33,7 @@ #include "SDL_endian.h" #include "SDL_video.h" #include "SDL_atarigl_c.h" -#ifdef ENABLE_OSMESA_SHARED +#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC #include "SDL_loadso.h" #endif @@ -49,7 +49,7 @@ static void SDL_AtariGL_UnloadLibrary(_THIS); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static void CopyShadowNull(_THIS, SDL_Surface *surface); static void CopyShadowDirect(_THIS, SDL_Surface *surface); static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface); @@ -76,7 +76,7 @@ static int InitOld(_THIS, SDL_Surface *current); int SDL_AtariGL_Init(_THIS, SDL_Surface *current) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (gl_oldmesa) { gl_active = InitOld(this, current); } else { @@ -89,7 +89,7 @@ int SDL_AtariGL_Init(_THIS, SDL_Surface *current) void SDL_AtariGL_Quit(_THIS, SDL_bool unload) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (gl_oldmesa) { /* Old mesa implementations */ if (this->gl_data->OSMesaDestroyLDG) { @@ -113,15 +113,15 @@ void SDL_AtariGL_Quit(_THIS, SDL_bool unload) SDL_AtariGL_UnloadLibrary(this); } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ gl_active = 0; } int SDL_AtariGL_LoadLibrary(_THIS, const char *path) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL -#ifdef ENABLE_OSMESA_SHARED +#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC void *handle; SDL_bool cancel_load; @@ -237,7 +237,7 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path) void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc) { void *func = NULL; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (this->gl_config.dll_handle) { func = SDL_LoadFunction(this->gl_config.dll_handle, (void *)proc); @@ -251,7 +251,7 @@ void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc) int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL GLenum mesa_attrib; SDL_Surface *surface; @@ -307,7 +307,7 @@ int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) int SDL_AtariGL_MakeCurrent(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL SDL_Surface *surface; GLenum type; @@ -351,7 +351,7 @@ int SDL_AtariGL_MakeCurrent(_THIS) void SDL_AtariGL_SwapBuffers(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (gl_active) { if (this->gl_config.dll_handle) { if (this->gl_data->glFinish) { @@ -370,7 +370,7 @@ void SDL_AtariGL_SwapBuffers(_THIS) void SDL_AtariGL_InitPointers(_THIS) { -#if defined(HAVE_OPENGL) +#if SDL_VIDEO_OPENGL this->gl_data->OSMesaCreateContextExt = OSMesaCreateContextExt; this->gl_data->OSMesaDestroyContext = OSMesaDestroyContext; this->gl_data->OSMesaMakeCurrent = OSMesaMakeCurrent; @@ -390,7 +390,7 @@ void SDL_AtariGL_InitPointers(_THIS) static void SDL_AtariGL_UnloadLibrary(_THIS) { -#if defined(HAVE_OPENGL) +#if SDL_VIDEO_OPENGL if (this->gl_config.dll_handle) { SDL_UnloadObject(this->gl_config.dll_handle); this->gl_config.dll_handle = NULL; @@ -403,7 +403,7 @@ static void SDL_AtariGL_UnloadLibrary(_THIS) /*--- Creation of an OpenGL context using new/old functions ---*/ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static int InitNew(_THIS, SDL_Surface *current) { GLenum osmesa_format; @@ -1084,4 +1084,4 @@ static void ConvertBGRAToABGR(_THIS, SDL_Surface *surface) } } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ diff --git a/src/video/ataricommon/SDL_atarigl_c.h b/src/video/ataricommon/SDL_atarigl_c.h index 18ca7ec5..e84e2866 100644 --- a/src/video/ataricommon/SDL_atarigl_c.h +++ b/src/video/ataricommon/SDL_atarigl_c.h @@ -25,11 +25,13 @@ #ifndef _SDL_ATARIGL_H_ #define _SDL_ATARIGL_H_ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #include <GL/osmesa.h> #endif -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" + +/* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this struct SDL_PrivateGLData { @@ -50,7 +52,7 @@ struct SDL_PrivateGLData { /* to convert the shadow buffer to the screen format */ void (*CopyShadow)(_THIS, SDL_Surface *surface); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL OSMesaContext ctx; /* OpenGL functions */ diff --git a/src/video/ataricommon/SDL_biosevents.c b/src/video/ataricommon/SDL_biosevents.c index 63653c27..a211ef73 100644 --- a/src/video/ataricommon/SDL_biosevents.c +++ b/src/video/ataricommon/SDL_biosevents.c @@ -30,8 +30,8 @@ #include <mint/osbind.h> #include <mint/cookie.h> -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_atarikeys.h" #include "SDL_atarievents_c.h" diff --git a/src/video/ataricommon/SDL_biosevents_c.h b/src/video/ataricommon/SDL_biosevents_c.h index 175492df..021172fb 100644 --- a/src/video/ataricommon/SDL_biosevents_c.h +++ b/src/video/ataricommon/SDL_biosevents_c.h @@ -29,7 +29,7 @@ #ifndef _SDL_ATARI_BIOSEVENTS_H_ #define _SDL_ATARI_BIOSEVENTS_H_ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ataricommon/SDL_gemdosevents.c b/src/video/ataricommon/SDL_gemdosevents.c index 066a6397..c410bcea 100644 --- a/src/video/ataricommon/SDL_gemdosevents.c +++ b/src/video/ataricommon/SDL_gemdosevents.c @@ -30,8 +30,8 @@ #include <mint/osbind.h> #include <mint/cookie.h> -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_atarikeys.h" #include "SDL_atarievents_c.h" diff --git a/src/video/ataricommon/SDL_gemdosevents_c.h b/src/video/ataricommon/SDL_gemdosevents_c.h index 05741402..f6ef7735 100644 --- a/src/video/ataricommon/SDL_gemdosevents_c.h +++ b/src/video/ataricommon/SDL_gemdosevents_c.h @@ -29,7 +29,7 @@ #ifndef _SDL_ATARI_GEMDOSEVENTS_H_ #define _SDL_ATARI_GEMDOSEVENTS_H_ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ataricommon/SDL_ikbdevents.c b/src/video/ataricommon/SDL_ikbdevents.c index 8387773e..ad1e748d 100644 --- a/src/video/ataricommon/SDL_ikbdevents.c +++ b/src/video/ataricommon/SDL_ikbdevents.c @@ -29,8 +29,8 @@ /* Mint includes */ #include <mint/osbind.h> -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_atarikeys.h" #include "SDL_atarievents_c.h" diff --git a/src/video/ataricommon/SDL_ikbdevents_c.h b/src/video/ataricommon/SDL_ikbdevents_c.h index 738434d3..af46ad7c 100644 --- a/src/video/ataricommon/SDL_ikbdevents_c.h +++ b/src/video/ataricommon/SDL_ikbdevents_c.h @@ -29,7 +29,7 @@ #ifndef _SDL_ATARI_IKBDEVENTS_H_ #define _SDL_ATARI_IKBDEVENTS_H_ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ataricommon/SDL_xbiosevents.c b/src/video/ataricommon/SDL_xbiosevents.c index 1ab684cc..0dd1582f 100644 --- a/src/video/ataricommon/SDL_xbiosevents.c +++ b/src/video/ataricommon/SDL_xbiosevents.c @@ -28,7 +28,7 @@ #include <mint/osbind.h> -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_xbiosevents_c.h" #include "SDL_xbiosinterrupt_s.h" diff --git a/src/video/ataricommon/SDL_xbiosevents_c.h b/src/video/ataricommon/SDL_xbiosevents_c.h index 9706bd58..211155cd 100644 --- a/src/video/ataricommon/SDL_xbiosevents_c.h +++ b/src/video/ataricommon/SDL_xbiosevents_c.h @@ -29,7 +29,7 @@ #ifndef _SDL_ATARI_XBIOSEVENTS_H_ #define _SDL_ATARI_XBIOSEVENTS_H_ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/bwindow/Makefile.am b/src/video/bwindow/Makefile.am deleted file mode 100644 index 718c27b7..00000000 --- a/src/video/bwindow/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ - -## Makefile.am for SDL using the BeOS BWindow video driver - -noinst_LTLIBRARIES = libvideo_bwindow.la -libvideo_bwindow_la_SOURCES = $(BWINDOW_SRCS) - -# The SDL BWindow video driver sources -BWINDOW_SRCS = \ - SDL_BView.h \ - SDL_BWin.h \ - SDL_lowvideo.h \ - SDL_sysevents.cc \ - SDL_sysevents_c.h \ - SDL_sysmouse.cc \ - SDL_sysmouse_c.h \ - SDL_sysvideo.cc \ - SDL_syswm.cc \ - SDL_syswm_c.h \ - SDL_sysyuv.cc \ - SDL_sysyuv.h - diff --git a/src/video/bwindow/SDL_BView.h b/src/video/bwindow/SDL_BView.h index b53d236b..91d5a182 100644 --- a/src/video/bwindow/SDL_BView.h +++ b/src/video/bwindow/SDL_BView.h @@ -26,7 +26,7 @@ /* This is the event handling and graphics update portion of SDL_BWin */ extern "C" { -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" }; class SDL_BView : public BView diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h index e48343b2..68d43615 100644 --- a/src/video/bwindow/SDL_BWin.h +++ b/src/video/bwindow/SDL_BWin.h @@ -27,7 +27,7 @@ #include <AppKit.h> #include <InterfaceKit.h> #include <be/game/DirectWindow.h> -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #include <be/opengl/GLView.h> #endif #include <support/UTF8.h> @@ -37,7 +37,7 @@ #include "SDL_BView.h" extern "C" { -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" }; class SDL_BWin : public BDirectWindow @@ -49,7 +49,7 @@ public: last_buttons = 0; the_view = NULL; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL SDL_GLView = NULL; #endif SDL_View = NULL; @@ -61,7 +61,7 @@ public: virtual ~SDL_BWin() { Lock(); if ( the_view ) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( the_view == SDL_GLView ) { SDL_GLView->UnlockGL(); } @@ -70,7 +70,7 @@ public: the_view = NULL; } Unlock(); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( SDL_GLView ) { delete SDL_GLView; } @@ -218,7 +218,7 @@ public: retval = 0; Lock(); if ( flags & SDL_OPENGL ) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( SDL_GLView == NULL ) { SDL_GLView = new BGLView(Bounds(), "SDL GLView", B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS), @@ -242,7 +242,7 @@ public: } if ( the_view != SDL_View ) { if ( the_view ) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( the_view == SDL_GLView ) { SDL_GLView->UnlockGL(); } @@ -260,7 +260,7 @@ public: SDL_View->SetBitmap(bitmap); } virtual void SetXYOffset(int x, int y) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( the_view == SDL_GLView ) { return; } @@ -268,7 +268,7 @@ public: SDL_View->SetXYOffset(x, y); } virtual void GetXYOffset(int &x, int &y) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( the_view == SDL_GLView ) { x = 0; y = 0; @@ -287,7 +287,7 @@ public: SDL_View->Sync(); Unlock(); } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL virtual void SwapBuffers(void) { SDL_GLView->UnlockGL(); SDL_GLView->LockGL(); @@ -540,7 +540,7 @@ public: } private: -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL BGLView *SDL_GLView; #endif SDL_BView *SDL_View; diff --git a/src/video/bwindow/SDL_lowvideo.h b/src/video/bwindow/SDL_lowvideo.h index d685f412..cb498e98 100644 --- a/src/video/bwindow/SDL_lowvideo.h +++ b/src/video/bwindow/SDL_lowvideo.h @@ -25,7 +25,7 @@ #include "SDL_BWin.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *_this diff --git a/src/video/bwindow/SDL_sysevents.cc b/src/video/bwindow/SDL_sysevents.cc index ac3fe861..212b5906 100644 --- a/src/video/bwindow/SDL_sysevents.cc +++ b/src/video/bwindow/SDL_sysevents.cc @@ -30,8 +30,8 @@ extern "C" { -#include "SDL_events_c.h" -#include "SDL_sysevents.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_sysevents_c.h" void BE_PumpEvents(_THIS) diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc index 34504b6a..2a86f50c 100644 --- a/src/video/bwindow/SDL_sysvideo.cc +++ b/src/video/bwindow/SDL_sysvideo.cc @@ -27,18 +27,18 @@ #include "SDL_BeApp.h" #include "SDL_BWin.h" #include "SDL_timer.h" -#include "blank_cursor.h" extern "C" { -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_sysmouse_c.h" -#include "SDL_sysevents_c.h" -#include "SDL_events_c.h" #include "SDL_syswm_c.h" #include "SDL_lowvideo.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" #include "SDL_sysyuv.h" +#include "../blank_cursor.h" #define BEOS_HIDDEN_SIZE 32 /* starting hidden window size */ @@ -60,7 +60,7 @@ static int BE_ToggleFullScreen(_THIS, int fullscreen); static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); /* OpenGL functions */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static int BE_GL_LoadLibrary(_THIS, const char *path); static void* BE_GL_GetProcAddress(_THIS, const char *proc); static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); @@ -123,7 +123,7 @@ static SDL_VideoDevice *BE_CreateDevice(int devindex) device->FlipHWSurface = NULL; device->FreeHWSurface = BE_FreeHWSurface; /* Gamma support */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* OpenGL support */ device->GL_LoadLibrary = BE_GL_LoadLibrary; device->GL_GetProcAddress = BE_GL_GetProcAddress; @@ -303,7 +303,7 @@ int BE_VideoInit(_THIS, SDL_PixelFormat *vformat) bounds.bottom = BEOS_HIDDEN_SIZE; SDL_Win = new SDL_BWin(bounds); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* testgl application doesn't load library, just tries to load symbols */ /* is it correct? if so we have to load library here */ BE_GL_LoadLibrary(_this, NULL); @@ -624,7 +624,7 @@ static void BE_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) } } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Passing a NULL path means load pointers from the application */ int BE_GL_LoadLibrary(_THIS, const char *path) { @@ -815,7 +815,7 @@ void BE_VideoQuit(_THIS) _this->screen->pixels = NULL; } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (_this->gl_config.dll_handle != NULL) unload_add_on((image_id)_this->gl_config.dll_handle); #endif diff --git a/src/video/bwindow/SDL_sysyuv.cc b/src/video/bwindow/SDL_sysyuv.cc index 0fd580d2..26a5205c 100644 --- a/src/video/bwindow/SDL_sysyuv.cc +++ b/src/video/bwindow/SDL_sysyuv.cc @@ -24,7 +24,7 @@ #include "SDL_video.h" #include "SDL_sysyuv.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" extern "C" { diff --git a/src/video/cybergfx/Makefile.am b/src/video/cybergfx/Makefile.am deleted file mode 100644 index 84746de2..00000000 --- a/src/video/cybergfx/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ - -## Makefile.am for SDL using the CyberGFX video driver - -noinst_LTLIBRARIES = libvideo_cgx.la -libvideo_cgx_la_SOURCES = $(CGX_SRCS) - -# The SDL CyberGFX video driver sources -CGX_SRCS = \ - SDL_amigaevents.c \ - SDL_amigaevents_c.h \ - SDL_amigamouse.c \ - SDL_amigamouse_c.h \ - SDL_cgxaccel.c \ - SDL_cgxgl.c \ - SDL_cgxgl_c.h \ - SDL_cgximage.c \ - SDL_cgximage_c.h \ - SDL_cgxmodes.c \ - SDL_cgxmodes_c.h \ - SDL_cgxvideo.c \ - SDL_cgxvideo.h \ - SDL_cgxwm.c \ - SDL_cgxwm_c.h \ - SDL_cgxyuv.c \ - SDL_cgxyuv_c.h diff --git a/src/video/cybergfx/SDL_amigaevents.c b/src/video/cybergfx/SDL_amigaevents.c index 2edca229..9de59d69 100644 --- a/src/video/cybergfx/SDL_amigaevents.c +++ b/src/video/cybergfx/SDL_amigaevents.c @@ -24,9 +24,9 @@ #include "SDL.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_cgxvideo.h" #include "SDL_cgxmodes_c.h" #include "SDL_cgximage_c.h" diff --git a/src/video/cybergfx/SDL_amigamouse.c b/src/video/cybergfx/SDL_amigamouse.c index 98cdd00c..e1428ea2 100644 --- a/src/video/cybergfx/SDL_amigamouse.c +++ b/src/video/cybergfx/SDL_amigamouse.c @@ -21,8 +21,8 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_amigamouse_c.h" @@ -73,40 +73,4 @@ void amiga_WarpWMCursor(_THIS, Uint16 x, Uint16 y) /* Check to see if we need to enter or leave mouse relative mode */ void amiga_CheckMouseMode(_THIS) { - /* If the mouse is hidden and input is grabbed, we use relative mode */ -#if 0 - SDL_Lock_EventThread(); - if ( !(SDL_cursorstate & CURSOR_VISIBLE) && - (this->input_grab != SDL_GRAB_OFF) ) { - mouse_relative = 1; - X11_EnableDGAMouse(this); - if ( ! (using_dga & DGA_MOUSE) ) { - char *use_mouse_accel; - - SDL_GetMouseState(&mouse_last.x, &mouse_last.y); - /* Use as raw mouse mickeys as possible */ - XGetPointerControl(SDL_Display, - &mouse_accel.numerator, - &mouse_accel.denominator, - &mouse_accel.threshold); - use_mouse_accel = SDL_getenv("SDL_VIDEO_X11_MOUSEACCEL"); - if ( use_mouse_accel ) { - SetMouseAccel(this, use_mouse_accel); - } - } - } else { - if ( mouse_relative ) { - if ( using_dga & DGA_MOUSE ) { - X11_DisableDGAMouse(this); - } else { - XChangePointerControl(SDL_Display, True, True, - mouse_accel.numerator, - mouse_accel.denominator, - mouse_accel.threshold); - } - mouse_relative = 0; - } - } - SDL_Unlock_EventThread(); -#endif } diff --git a/src/video/cybergfx/SDL_cgxaccel.c b/src/video/cybergfx/SDL_cgxaccel.c index b0a87aae..078f0179 100644 --- a/src/video/cybergfx/SDL_cgxaccel.c +++ b/src/video/cybergfx/SDL_cgxaccel.c @@ -22,8 +22,8 @@ #include "SDL_endian.h" #include "SDL_video.h" -#include "SDL_sysvideo.h" -#include "SDL_blit.h" +#include "../SDL_sysvideo.h" +#include "../SDL_blit.h" #include "SDL_cgxvideo.h" static int CGX_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, diff --git a/src/video/cybergfx/SDL_cgxgl.c b/src/video/cybergfx/SDL_cgxgl.c index 78d167e3..f1f441e4 100644 --- a/src/video/cybergfx/SDL_cgxgl.c +++ b/src/video/cybergfx/SDL_cgxgl.c @@ -25,14 +25,14 @@ #include "SDL_cgxgl_c.h" #include "SDL_cgxvideo.h" -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL AmigaMesaContext glcont=NULL; #endif /* Init OpenGL */ int CGX_GL_Init(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL int i = 0; struct TagItem attributes [ 14 ]; /* 14 should be more than enough :) */ struct Window *win = (struct Window *)SDL_Window; @@ -101,7 +101,7 @@ int CGX_GL_Init(_THIS) /* Quit OpenGL */ void CGX_GL_Quit(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( glcont != NULL ) { AmigaMesaDestroyContext(glcont); glcont = NULL; @@ -114,7 +114,7 @@ void CGX_GL_Quit(_THIS) /* Attach context to another window */ int CGX_GL_Update(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL struct TagItem tags[2]; struct Window *win = (struct Window*)SDL_Window; if(glcont == NULL) { @@ -132,7 +132,7 @@ int CGX_GL_Update(_THIS) #endif } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Make the current context active */ int CGX_GL_MakeCurrent(_THIS) @@ -207,5 +207,5 @@ int CGX_GL_LoadLibrary(_THIS, const char *path) { return 0; } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ diff --git a/src/video/cybergfx/SDL_cgxgl_c.h b/src/video/cybergfx/SDL_cgxgl_c.h index 2d7cce68..c1dfccf1 100644 --- a/src/video/cybergfx/SDL_cgxgl_c.h +++ b/src/video/cybergfx/SDL_cgxgl_c.h @@ -22,13 +22,14 @@ /* StormMesa implementation of SDL OpenGL support */ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" + #define _THIS SDL_VideoDevice *_this -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #include <GL/Amigamesa.h> extern void *AmiGetGLProc(const char *proc); -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ struct SDL_PrivateGLData { int gl_active; @@ -38,7 +39,7 @@ struct SDL_PrivateGLData { extern int CGX_GL_Init(_THIS); extern void CGX_GL_Quit(_THIS); extern int CGX_GL_Update(_THIS); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL extern int CGX_GL_MakeCurrent(_THIS); extern int CGX_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void CGX_GL_SwapBuffers(_THIS); diff --git a/src/video/cybergfx/SDL_cgxmodes.c b/src/video/cybergfx/SDL_cgxmodes.c index 54c2a6dc..1fbbf566 100644 --- a/src/video/cybergfx/SDL_cgxmodes.c +++ b/src/video/cybergfx/SDL_cgxmodes.c @@ -24,7 +24,7 @@ #include "SDL_timer.h" #include "SDL_events.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_cgxvideo.h" #include "SDL_cgxwm_c.h" #include "SDL_cgxmodes_c.h" @@ -272,23 +272,6 @@ int CGX_EnterFullScreen(_THIS) CGX_DestroyWindow(this,this->screen); set_best_resolution(this, real_w,real_h); - /* Grab the mouse on the fullscreen window - The event handling will know when we become active, and then - enter fullscreen mode if we can't grab the mouse this time. - */ -#if 0 - if ( (XGrabPointer(SDL_Display, FSwindow, True, 0, - GrabModeAsync, GrabModeAsync, - FSwindow, None, CurrentTime) != GrabSuccess) || - (XGrabKeyboard(SDL_Display, WMwindow, True, - GrabModeAsync, GrabModeAsync, CurrentTime) != 0) ) { - XUnmapWindow(SDL_Display, FSwindow); - X11_WaitUnmapped(this, FSwindow); - X11_QueueEnterFullScreen(this); - return(0); - } -#endif - currently_fullscreen = 1; this->screen->flags = saved_flags; diff --git a/src/video/cybergfx/SDL_cgxvideo.c b/src/video/cybergfx/SDL_cgxvideo.c index 268b037c..4e443c6b 100644 --- a/src/video/cybergfx/SDL_cgxvideo.c +++ b/src/video/cybergfx/SDL_cgxvideo.c @@ -30,9 +30,9 @@ #include "SDL_thread.h" #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_cgxgl_c.h" #include "SDL_cgxvideo.h" #include "SDL_cgxwm_c.h" @@ -40,7 +40,6 @@ #include "SDL_amigaevents_c.h" #include "SDL_cgxmodes_c.h" #include "SDL_cgximage_c.h" -#include "SDL_cgxyuv_c.h" /* Initialization/Query functions */ static int CGX_VideoInit(_THIS, SDL_PixelFormat *vformat); @@ -208,9 +207,6 @@ static SDL_VideoDevice *CGX_CreateDevice(int devindex) device->SetVideoMode = CGX_SetVideoMode; device->ToggleFullScreen = CGX_ToggleFullScreen; device->UpdateMouse = CGX_UpdateMouse; -#ifdef XFREE86_XV - device->CreateYUVOverlay = X11_CreateYUVOverlay; -#endif device->SetColors = CGX_SetColors; device->UpdateRects = NULL; device->VideoQuit = CGX_VideoQuit; @@ -227,7 +223,7 @@ static SDL_VideoDevice *CGX_CreateDevice(int devindex) device->GetGamma = CGX_GetGamma; device->SetGammaRamp = CGX_SetGammaRamp; device->GetGammaRamp = NULL; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_LoadLibrary = CGX_GL_LoadLibrary; device->GL_GetProcAddress = CGX_GL_GetProcAddress; device->GL_GetAttribute = CGX_GL_GetAttribute; diff --git a/src/video/cybergfx/SDL_cgxvideo.h b/src/video/cybergfx/SDL_cgxvideo.h index d0d28317..e4f5f91b 100644 --- a/src/video/cybergfx/SDL_cgxvideo.h +++ b/src/video/cybergfx/SDL_cgxvideo.h @@ -44,7 +44,7 @@ #endif #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #include "mydebug.h" #define USE_CGX_WRITELUTPIXEL diff --git a/src/video/cybergfx/SDL_cgxwm.c b/src/video/cybergfx/SDL_cgxwm.c index 02e6d419..5ce8f3bb 100644 --- a/src/video/cybergfx/SDL_cgxwm.c +++ b/src/video/cybergfx/SDL_cgxwm.c @@ -24,8 +24,8 @@ #include "SDL_timer.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_events_c.h" -#include "SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_pixels_c.h" #include "SDL_cgxmodes_c.h" #include "SDL_cgxwm_c.h" @@ -34,166 +34,7 @@ void CGX_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask) { -#if 0 - SDL_Surface *sicon; - XWMHints *wmhints; - XImage *icon_image; - Pixmap icon_pixmap; - Pixmap mask_pixmap; -#ifdef USE_ICON_WINDOW - Window icon_window; -#endif - GC GC; - XGCValues GCvalues; - int i, b, dbpp; - SDL_Rect bounds; - Uint8 *LSBmask, *color_tried; - Visual *dvis; - - /* Lock the event thread, in multi-threading environments */ - SDL_Lock_EventThread(); - - /* The icon must use the default visual, depth and colormap of the - screen, so it might need a conversion */ - dbpp = DefaultDepth(SDL_Display, SDL_Screen); - switch(dbpp) { - case 15: - dbpp = 16; break; - case 24: - dbpp = 32; break; - } - dvis = DefaultVisual(SDL_Display, SDL_Screen); - - /* The Visual struct is supposed to be opaque but we cheat a little */ - sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h, - dbpp, - dvis->red_mask, dvis->green_mask, - dvis->blue_mask, 0); - - if ( sicon == NULL ) { - goto done; - } - /* If we already have allocated colours from the default colormap, - copy them */ - if(SDL_Visual == dvis && SDL_XColorMap == SDL_DisplayColormap - && this->screen->format->palette && sicon->format->palette) { - SDL_memcpy(sicon->format->palette->colors, - this->screen->format->palette->colors, - this->screen->format->palette->ncolors * sizeof(SDL_Color)); - } - - bounds.x = 0; - bounds.y = 0; - bounds.w = icon->w; - bounds.h = icon->h; - if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 ) - goto done; - - /* Lock down the colors used in the colormap */ - color_tried = NULL; - if ( sicon->format->BitsPerPixel == 8 ) { - SDL_Palette *palette; - Uint8 *p; - XColor wanted; - - palette = sicon->format->palette; - color_tried = SDL_malloc(palette->ncolors); - if ( color_tried == NULL ) { - goto done; - } - if ( SDL_iconcolors != NULL ) { - SDL_free(SDL_iconcolors); - } - SDL_iconcolors = SDL_malloc(palette->ncolors - * sizeof(*SDL_iconcolors)); - if ( SDL_iconcolors == NULL ) { - SDL_free(color_tried); - goto done; - } - SDL_memset(color_tried, 0, palette->ncolors); - SDL_memset(SDL_iconcolors, 0, - palette->ncolors * sizeof(*SDL_iconcolors)); - - p = (Uint8 *)sicon->pixels; - for ( i = sicon->w*sicon->h; i > 0; --i, ++p ) { - if ( ! color_tried[*p] ) { - wanted.pixel = *p; - wanted.red = (palette->colors[*p].r<<8); - wanted.green = (palette->colors[*p].g<<8); - wanted.blue = (palette->colors[*p].b<<8); - wanted.flags = (DoRed|DoGreen|DoBlue); - if (XAllocColor(SDL_Display, - SDL_DisplayColormap, &wanted)) { - ++SDL_iconcolors[wanted.pixel]; - } - color_tried[*p] = 1; - } - } - } - if ( color_tried != NULL ) { - SDL_free(color_tried); - } - - /* Translate mask data to LSB order and set the icon mask */ - i = (sicon->w/8)*sicon->h; - LSBmask = (Uint8 *)SDL_malloc(i); - if ( LSBmask == NULL ) { - goto done; - } - SDL_memset(LSBmask, 0, i); - while ( --i >= 0 ) { - for ( b=0; b<8; ++b ) - LSBmask[i] |= (((mask[i]>>b)&0x01)<<(7-b)); - } - mask_pixmap = XCreatePixmapFromBitmapData(SDL_Display, WMwindow, - LSBmask, sicon->w, sicon->h, 1L, 0L, 1); - - /* Transfer the image to an X11 pixmap */ - icon_image = XCreateImage(SDL_Display, - DefaultVisual(SDL_Display, SDL_Screen), - DefaultDepth(SDL_Display, SDL_Screen), - ZPixmap, 0, (char *)sicon->pixels, sicon->w, sicon->h, - ((sicon->format)->BytesPerPixel == 3) ? 32 : - (sicon->format)->BytesPerPixel*8, 0); - icon_pixmap = XCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h, - DefaultDepth(SDL_Display, SDL_Screen)); - GC = XCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues); - XPutImage(SDL_Display, icon_pixmap, GC, icon_image, - 0, 0, 0, 0, sicon->w, sicon->h); - XFreeGC(SDL_Display, GC); - XDestroyImage(icon_image); - SDL_free(LSBmask); - sicon->pixels = NULL; - -#ifdef USE_ICON_WINDOW - /* Create an icon window and set the pixmap as its background */ - icon_window = XCreateSimpleWindow(SDL_Display, SDL_Root, - 0, 0, sicon->w, sicon->h, 0, - CopyFromParent, CopyFromParent); - XSetWindowBackgroundPixmap(SDL_Display, icon_window, icon_pixmap); - XClearWindow(SDL_Display, icon_window); -#endif - - /* Set the window icon to the icon pixmap (and icon window) */ - wmhints = XAllocWMHints(); - wmhints->flags = (IconPixmapHint | IconMaskHint); - wmhints->icon_pixmap = icon_pixmap; - wmhints->icon_mask = mask_pixmap; -#ifdef USE_ICON_WINDOW - wmhints->flags |= IconWindowHint; - wmhints->icon_window = icon_window; -#endif - XSetWMHints(SDL_Display, WMwindow, wmhints); - XFree(wmhints); - XSync(SDL_Display, False); - - done: - SDL_Unlock_EventThread(); - if ( sicon != NULL ) { - SDL_FreeSurface(sicon); - } -#endif - return; +/* Not yet implemented */ } void CGX_SetCaption(_THIS, const char *title, const char *icon) @@ -205,117 +46,13 @@ void CGX_SetCaption(_THIS, const char *title, const char *icon) /* Iconify the window */ int CGX_IconifyWindow(_THIS) { -#if 0 - int result; - - SDL_Lock_EventThread(); - result = XIconifyWindow(SDL_Display, WMwindow, SDL_Screen); - XSync(SDL_Display, False); - SDL_Unlock_EventThread(); - return(result); -#else +/* Not yet implemented */ return 0; -#endif } -#if 0 -SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode) -{ - int numtries, result; - - if ( this->screen == NULL ) { - return(SDL_GRAB_OFF); - } - if ( ! SDL_Window ) { - return(mode); /* Will be set later on mode switch */ - } - if ( mode == SDL_GRAB_OFF ) { - XUngrabPointer(SDL_Display, CurrentTime); - if ( this->screen->flags & SDL_FULLSCREEN ) { - /* Rebind the mouse to the fullscreen window */ - for ( numtries = 0; numtries < 10; ++numtries ) { - result = XGrabPointer(SDL_Display, FSwindow, - True, 0, - GrabModeAsync, GrabModeAsync, - FSwindow, None, CurrentTime); - if ( result == AlreadyGrabbed ) { - break; - } - SDL_Delay(100); - } - } -#ifdef GRAB_FULLSCREEN - if ( !(this->screen->flags & SDL_FULLSCREEN) ) -#endif - XUngrabKeyboard(SDL_Display, CurrentTime); - } else { - if ( this->screen->flags & SDL_FULLSCREEN ) { - /* Unbind the mouse from the fullscreen window */ - XUngrabPointer(SDL_Display, CurrentTime); - } - /* Try to grab the mouse */ - for ( numtries = 0; numtries < 10; ++numtries ) { - result = XGrabPointer(SDL_Display, SDL_Window, True, 0, - GrabModeAsync, GrabModeAsync, - SDL_Window, None, CurrentTime); - if ( result != AlreadyGrabbed ) { - break; - } - SDL_Delay(100); - } -#ifdef GRAB_FULLSCREEN - if ( !(this->screen->flags & SDL_FULLSCREEN) ) -#endif - XGrabKeyboard(SDL_Display, WMwindow, True, - GrabModeAsync, GrabModeAsync, CurrentTime); - } - XSync(SDL_Display, False); - - return(mode); -} - -SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode) -{ - SDL_Lock_EventThread(); - mode = X11_GrabInputNoLock(this, mode); - SDL_Unlock_EventThread(); - - return(mode); -} - -/* If 'info' is the right version, this function fills it and returns 1. - Otherwise, in case of a version mismatch, it returns -1. -*/ -static void lock_display(void) -{ - SDL_Lock_EventThread(); -} -static void unlock_display(void) -{ - /* Make sure any X11 transactions are completed */ - SDL_VideoDevice *this = current_video; - XSync(SDL_Display, False); - SDL_Unlock_EventThread(); -} - -#endif - int CGX_GetWMInfo(_THIS, SDL_SysWMinfo *info) { if ( info->version.major <= SDL_MAJOR_VERSION ) { -#if 0 - info->subsystem = SDL_SYSWM_X11; - info->info.x11.display = SDL_Display; - info->info.x11.window = SDL_Window; - if ( SDL_VERSIONNUM(info->version.major, - info->version.minor, - info->version.patch) >= 1002 ) { - info->info.x11.fswindow = FSwindow; - info->info.x11.wmwindow = WMwindow; - } - info->info.x11.lock_func = lock_display; - info->info.x11.unlock_func = unlock_display; -#endif return(1); } else { SDL_SetError("Application not compiled with SDL %d.%d\n", diff --git a/src/video/cybergfx/SDL_cgxyuv.c b/src/video/cybergfx/SDL_cgxyuv.c deleted file mode 100644 index 5256e1b9..00000000 --- a/src/video/cybergfx/SDL_cgxyuv.c +++ /dev/null @@ -1,183 +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 -*/ - -/* This is the XFree86 Xv extension implementation of YUV video overlays */ - -#ifdef XFREE86_XV - -#include <X11/Xlib.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <X11/extensions/XShm.h> -#include <X11/extensions/Xvlib.h> - -#include "SDL_video.h" -#include "SDL_x11yuv_c.h" -#include "SDL_yuvfuncs.h" - -/* The functions used to manipulate software video overlays */ -static struct private_yuvhwfuncs x11_yuvfuncs = { - X11_LockYUVOverlay, - X11_UnlockYUVOverlay, - X11_DisplayYUVOverlay, - X11_FreeYUVOverlay -}; - -struct private_yuvhwdata { - int port; - XShmSegmentInfo yuvshm; - XvImage *image; -}; - - -SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display) -{ - SDL_Overlay *overlay; - struct private_yuvhwdata *hwdata; - int xv_port; - int i, j; - int adaptors; - XvAdaptorInfo *ainfo; - XShmSegmentInfo *yuvshm; - - xv_port = -1; - if ( (Success == XvQueryExtension(GFX_Display, &j, &j, &j, &j, &j)) && - (Success == XvQueryAdaptors(GFX_Display, - RootWindow(GFX_Display, SDL_Screen), - &adaptors, &ainfo)) ) { - for ( i=0; (i<adaptors) && (xv_port == -1); ++i ) { - if ( (ainfo[i].type & XvInputMask) && - (ainfo[i].type & XvImageMask) ) { - int num_formats; - XvImageFormatValues *formats; - formats = XvListImageFormats(GFX_Display, - ainfo[i].base_id, &num_formats); - for ( j=0; j<num_formats; ++j ) { - if ( (Uint32)formats[j].id == format ) { - xv_port = ainfo[i].base_id; - break; - } - } - } - } - } - if ( xv_port == -1 ) { - SDL_SetError("No available video ports for requested format"); - return(NULL); - } - - /* Create the overlay structure */ - overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay); - if ( overlay == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(overlay, 0, (sizeof *overlay)); - - /* Fill in the basic members */ - overlay->format = format; - overlay->w = width; - overlay->h = height; - - /* Set up the YUV surface function structure */ - overlay->hwfuncs = &x11_yuvfuncs; - - /* Create the pixel data and lookup tables */ - hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata); - overlay->hwdata = hwdata; - if ( hwdata == NULL ) { - SDL_OutOfMemory(); - SDL_FreeYUVOverlay(overlay); - return(NULL); - } - yuvshm = &hwdata->yuvshm; - SDL_memset(yuvshm, 0, sizeof(*yuvshm)); - hwdata->port = xv_port; - hwdata->image = XvShmCreateImage(GFX_Display, xv_port, format, - 0, width, height, yuvshm); - if ( hwdata->image == NULL ) { - SDL_OutOfMemory(); - SDL_FreeYUVOverlay(overlay); - return(NULL); - } - yuvshm->shmid = shmget(IPC_PRIVATE, hwdata->image->data_size, - IPC_CREAT | 0777); - if ( yuvshm->shmid < 0 ) { - SDL_SetError("Unable to get %d bytes shared memory", - hwdata->image->data_size); - SDL_FreeYUVOverlay(overlay); - return(NULL); - } - yuvshm->shmaddr = (caddr_t) shmat(yuvshm->shmid, 0, 0); - yuvshm->readOnly = False; - hwdata->image->data = yuvshm->shmaddr; - - XShmAttach(GFX_Display, yuvshm); - XSync(GFX_Display, False); - shmctl(yuvshm->shmid, IPC_RMID, 0); - - /* We're all done.. */ - return(overlay); -} - -int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay) -{ - overlay->pixels = overlay->hwdata->image->data; - /* What should the pitch be set to? */ - return(0); -} - -void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay) -{ - overlay->pixels = NULL; -} - -int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect) -{ - struct private_yuvhwdata *hwdata; - - hwdata = overlay->hwdata; - XvShmPutImage(GFX_Display, hwdata->port, SDL_Window, SDL_GC, - hwdata->image, 0, 0, overlay->w, overlay->h, - dstrect->x, dstrect->y, dstrect->w, dstrect->h, False); - XSync(GFX_Display, False); - return(0); -} - -void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay) -{ - struct private_yuvhwdata *hwdata; - - hwdata = overlay->hwdata; - if ( hwdata ) { - if ( hwdata->yuvshm.shmaddr ) { - XShmDetach(GFX_Display, &hwdata->yuvshm); - shmdt(hwdata->yuvshm.shmaddr); - } - if ( hwdata->image ) { - XFree(hwdata->image); - } - SDL_free(hwdata); - } -} - -#endif /* XFREE86_XV */ diff --git a/src/video/cybergfx/SDL_cgxyuv_c.h b/src/video/cybergfx/SDL_cgxyuv_c.h deleted file mode 100644 index 616350d6..00000000 --- a/src/video/cybergfx/SDL_cgxyuv_c.h +++ /dev/null @@ -1,40 +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 -*/ - -/* This is the XFree86 Xv extension implementation of YUV video overlays */ - -#include "SDL_video.h" -#include "SDL_cgxvideo.h" - -#ifdef XFREE86_XV - -extern SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); - -extern int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay); - -extern void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay); - -extern int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect); - -extern void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay); - -#endif /* XFREE86_XV */ diff --git a/src/video/dc/Makefile.am b/src/video/dc/Makefile.am deleted file mode 100644 index 040a67a6..00000000 --- a/src/video/dc/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -## Makefile.am for SDL using the Dreamcast video driver - -noinst_LTLIBRARIES = libvideo_dc.la -libvideo_dc_la_SOURCES = $(SRCS) - -# The SDL Dreamcast video driver sources -SRCS = \ - SDL_dcevents.c \ - SDL_dcevents_c.h \ - SDL_dcmouse.c \ - SDL_dcmouse_c.h \ - SDL_dcvideo.c \ - SDL_dcvideo.h diff --git a/src/video/dc/SDL_dcevents.c b/src/video/dc/SDL_dcevents.c index 83e02135..940bdbb8 100644 --- a/src/video/dc/SDL_dcevents.c +++ b/src/video/dc/SDL_dcevents.c @@ -21,8 +21,8 @@ */ #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_dcvideo.h" #include "SDL_dcevents_c.h" diff --git a/src/video/dc/SDL_dcmouse.c b/src/video/dc/SDL_dcmouse.c index 4fcbaf17..c66992af 100644 --- a/src/video/dc/SDL_dcmouse.c +++ b/src/video/dc/SDL_dcmouse.c @@ -23,7 +23,7 @@ #include <stdio.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_dcmouse_c.h" diff --git a/src/video/dc/SDL_dcvideo.c b/src/video/dc/SDL_dcvideo.c index 4fc05ef4..9dd7d94f 100644 --- a/src/video/dc/SDL_dcvideo.c +++ b/src/video/dc/SDL_dcvideo.c @@ -22,9 +22,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_dcvideo.h" #include "SDL_dcevents_c.h" @@ -33,10 +33,6 @@ #include <dc/video.h> #include <dc/pvr.h> -#ifdef HAVE_OPENGL -#include <GL/gl.h> -#endif - /* Initialization/Query functions */ static int DC_VideoInit(_THIS, SDL_PixelFormat *vformat); @@ -111,7 +107,7 @@ static SDL_VideoDevice *DC_CreateDevice(int devindex) device->UnlockHWSurface = DC_UnlockHWSurface; device->FlipHWSurface = DC_FlipHWSurface; device->FreeHWSurface = DC_FreeHWSurface; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_LoadLibrary = DC_GL_LoadLibrary; device->GL_GetProcAddress = DC_GL_GetProcAddress; device->GL_GetAttribute = DC_GL_GetAttribute; @@ -184,7 +180,7 @@ pvr_init_params_t params = { 512*1024 }; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static int pvr_inited; #endif @@ -220,7 +216,7 @@ SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current, Rmask = 0x00ff0000; Gmask = 0x0000ff00; Bmask = 0x000000ff; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (!(flags & SDL_OPENGL)) #endif break; @@ -241,7 +237,7 @@ SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current, current->h = height; current->pitch = pitch; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (pvr_inited) { pvr_inited = 0; pvr_shutdown(); @@ -252,7 +248,7 @@ SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current, current->pixels = vram_s; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (flags & SDL_OPENGL) { this->gl_config.driver_loaded = 1; current->flags = SDL_FULLSCREEN | SDL_OPENGL; @@ -318,7 +314,7 @@ static int DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) */ static void DC_VideoQuit(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (pvr_inited) { pvr_inited = 0; pvr_shutdown(); @@ -326,7 +322,7 @@ static void DC_VideoQuit(_THIS) #endif } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL void dmyfunc(void) {} diff --git a/src/video/dc/SDL_dcvideo.h b/src/video/dc/SDL_dcvideo.h index 42705c7a..86d53e42 100644 --- a/src/video/dc/SDL_dcvideo.h +++ b/src/video/dc/SDL_dcvideo.h @@ -24,8 +24,8 @@ #define _SDL_dcvideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/dga/Makefile.am b/src/video/dga/Makefile.am deleted file mode 100644 index e1ea5e05..00000000 --- a/src/video/dga/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -## Makefile.am for SDL using the DGA 2.0 video driver - -noinst_LTLIBRARIES = libvideo_dga.la -libvideo_dga_la_SOURCES = $(DGA_SRCS) - -# The SDL DGA 2.0 video driver sources -DGA_SRCS = \ - SDL_dgaevents.c \ - SDL_dgaevents_c.h \ - SDL_dgamouse.c \ - SDL_dgamouse_c.h \ - SDL_dgavideo.c \ - SDL_dgavideo.h diff --git a/src/video/dga/SDL_dgaevents.c b/src/video/dga/SDL_dgaevents.c index f85a40b4..d81d8ead 100644 --- a/src/video/dga/SDL_dgaevents.c +++ b/src/video/dga/SDL_dgaevents.c @@ -24,10 +24,10 @@ #include <stdio.h> #include <X11/Xlib.h> -#include <Xext/extensions/xf86dga.h> +#include "../Xext/extensions/xf86dga.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_events_c.h" #include "SDL_dgavideo.h" #include "SDL_dgaevents_c.h" diff --git a/src/video/dga/SDL_dgamouse.c b/src/video/dga/SDL_dgamouse.c index 477772be..aa85b6cc 100644 --- a/src/video/dga/SDL_dgamouse.c +++ b/src/video/dga/SDL_dgamouse.c @@ -23,7 +23,7 @@ #include <stdio.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_dgavideo.h" #include "SDL_dgamouse_c.h" diff --git a/src/video/dga/SDL_dgavideo.c b/src/video/dga/SDL_dgavideo.c index e83eb39f..da8da94d 100644 --- a/src/video/dga/SDL_dgavideo.c +++ b/src/video/dga/SDL_dgavideo.c @@ -26,13 +26,13 @@ #include <stdio.h> #include <X11/Xlib.h> -#include <Xext/extensions/xf86dga.h> +#include "../Xext/extensions/xf86dga.h" #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_dgavideo.h" #include "SDL_dgamouse_c.h" #include "SDL_dgaevents_c.h" diff --git a/src/video/dga/SDL_dgavideo.h b/src/video/dga/SDL_dgavideo.h index 28f5f15f..b7465db6 100644 --- a/src/video/dga/SDL_dgavideo.h +++ b/src/video/dga/SDL_dgavideo.h @@ -27,7 +27,7 @@ #include "SDL_mouse.h" #include "SDL_mutex.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/directfb/Makefile.am b/src/video/directfb/Makefile.am deleted file mode 100644 index ffa21ebd..00000000 --- a/src/video/directfb/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -## Makefile.am for SDL using the DirectFB video driver - -INCLUDES = $(DIRECTFB_CFLAGS) - -noinst_LTLIBRARIES = libvideo_directfb.la -libvideo_directfb_la_SOURCES = $(DIRECTFB_SRCS) -libvideo_directfb_la_LIBADD = $(DIRECTFB_LIBS) - -# The SDL DirectFB video driver sources -DIRECTFB_SRCS = \ - SDL_DirectFB_events.c \ - SDL_DirectFB_events.h \ - SDL_DirectFB_video.c \ - SDL_DirectFB_video.h \ - SDL_DirectFB_yuv.c \ - SDL_DirectFB_yuv.h diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index 48ba8c78..26ce843a 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -31,9 +31,9 @@ #include <directfb.h> #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_events.h" diff --git a/src/video/directfb/SDL_DirectFB_video.c b/src/video/directfb/SDL_DirectFB_video.c index 753df909..19d72ea7 100644 --- a/src/video/directfb/SDL_DirectFB_video.c +++ b/src/video/directfb/SDL_DirectFB_video.c @@ -36,9 +36,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_events.h" #include "SDL_DirectFB_yuv.h" diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index 77ed3f02..82c111ca 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -26,7 +26,7 @@ #include <directfb.h> #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #define _THIS SDL_VideoDevice *this diff --git a/src/video/directfb/SDL_DirectFB_yuv.c b/src/video/directfb/SDL_DirectFB_yuv.c index 896a9a17..5da94cb5 100644 --- a/src/video/directfb/SDL_DirectFB_yuv.c +++ b/src/video/directfb/SDL_DirectFB_yuv.c @@ -24,7 +24,7 @@ #include "SDL_video.h" #include "SDL_DirectFB_yuv.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" /* The functions used to manipulate software video overlays */ diff --git a/src/video/dummy/Makefile.am b/src/video/dummy/Makefile.am deleted file mode 100644 index b9138cc5..00000000 --- a/src/video/dummy/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for SDL using the null video driver - -noinst_LTLIBRARIES = libvideo_null.la -libvideo_null_la_SOURCES = $(NULL_SRCS) - -# The SDL null video driver sources -NULL_SRCS = \ - SDL_nullvideo.h \ - SDL_nullevents.c \ - SDL_nullevents_c.h \ - SDL_nullmouse.c \ - SDL_nullmouse_c.h \ - SDL_nullvideo.c - diff --git a/src/video/dummy/SDL_nullevents.c b/src/video/dummy/SDL_nullevents.c index 34361a20..f22701a2 100644 --- a/src/video/dummy/SDL_nullevents.c +++ b/src/video/dummy/SDL_nullevents.c @@ -24,8 +24,9 @@ most of the API. */ #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" + #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" diff --git a/src/video/dummy/SDL_nullmouse.c b/src/video/dummy/SDL_nullmouse.c index 993d4470..56e15df7 100644 --- a/src/video/dummy/SDL_nullmouse.c +++ b/src/video/dummy/SDL_nullmouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_nullmouse_c.h" diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index c69638e9..c5243e39 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -37,9 +37,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" diff --git a/src/video/dummy/SDL_nullvideo.h b/src/video/dummy/SDL_nullvideo.h index c04a167d..db135fa7 100644 --- a/src/video/dummy/SDL_nullvideo.h +++ b/src/video/dummy/SDL_nullvideo.h @@ -23,9 +23,7 @@ #ifndef _SDL_nullvideo_h #define _SDL_nullvideo_h -#include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_mutex.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/epoc/Makefile.am b/src/video/epoc/Makefile.am deleted file mode 100644 index 9f5a6fd0..00000000 --- a/src/video/epoc/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ - -## Makefile.am for SDL using the EPOC video driver - -noinst_LTLIBRARIES = libvideo_epoc.la -libvideo_epoc_la_SOURCES = $(EPOC_SRCS) - -# The SDL EPOC video driver sources -EPOC_SRCS = \ - SDL_epocevents.cpp \ - SDL_epocevents_c.h \ - SDL_epocvideo.cpp \ - SDL_epocvideo.h diff --git a/src/video/epoc/SDL_epocevents.cpp b/src/video/epoc/SDL_epocevents.cpp index c3a1f7d9..32fdae4d 100644 --- a/src/video/epoc/SDL_epocevents.cpp +++ b/src/video/epoc/SDL_epocevents.cpp @@ -36,8 +36,8 @@ extern "C" { #include "SDL_video.h" #include "SDL_keysym.h" #include "SDL_keyboard.h" -#include "SDL_events_c.h" #include "SDL_timer.h" +#include "../../events/SDL_events_c.h" }; /* extern "C" */ #include "SDL_epocvideo.h" diff --git a/src/video/epoc/SDL_epocevents_c.h b/src/video/epoc/SDL_epocevents_c.h index ec914ca1..3714dc95 100644 --- a/src/video/epoc/SDL_epocevents_c.h +++ b/src/video/epoc/SDL_epocevents_c.h @@ -29,7 +29,7 @@ extern "C" { -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" }; #define MAX_SCANCODE 255 diff --git a/src/video/epoc/SDL_epocvideo.cpp b/src/video/epoc/SDL_epocvideo.cpp index 4716a3e4..13f4a131 100644 --- a/src/video/epoc/SDL_epocvideo.cpp +++ b/src/video/epoc/SDL_epocvideo.cpp @@ -33,7 +33,7 @@ extern "C" { #include "SDL_timer.h" #include "SDL_video.h" #undef NULL -#include "SDL_pixels_c.h" +#include "../SDL_pixels_c.h" }; #include "SDL_epocvideo.h" diff --git a/src/video/epoc/SDL_epocvideo.h b/src/video/epoc/SDL_epocvideo.h index b357c5b7..1fccc12f 100644 --- a/src/video/epoc/SDL_epocvideo.h +++ b/src/video/epoc/SDL_epocvideo.h @@ -32,7 +32,7 @@ extern "C" { #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" }; #include <e32std.h> diff --git a/src/video/fbcon/Makefile.am b/src/video/fbcon/Makefile.am deleted file mode 100644 index ec3f8dd3..00000000 --- a/src/video/fbcon/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ - -## Makefile.am for SDL using the framebuffer console video driver - -noinst_LTLIBRARIES = libvideo_fbcon.la -libvideo_fbcon_la_SOURCES = $(FBCON_SRCS) - -# The SDL framebuffer console video driver sources -FBCON_SRCS = \ - SDL_fbkeys.h \ - SDL_fbvideo.h \ - SDL_fbelo.c \ - SDL_fbelo.h \ - SDL_fbevents.c \ - SDL_fbevents_c.h \ - SDL_fb3dfx.c \ - SDL_fb3dfx.h \ - SDL_fbmatrox.c \ - SDL_fbmatrox.h \ - SDL_fbmouse.c \ - SDL_fbmouse_c.h \ - SDL_fbriva.c \ - SDL_fbriva.h \ - SDL_fbvideo.c \ - 3dfx_mmio.h \ - 3dfx_regs.h \ - matrox_mmio.h \ - matrox_regs.h \ - riva_mmio.h \ - riva_regs.h diff --git a/src/video/fbcon/SDL_fb3dfx.c b/src/video/fbcon/SDL_fb3dfx.c index 1a7ff920..ba4d77ae 100644 --- a/src/video/fbcon/SDL_fb3dfx.c +++ b/src/video/fbcon/SDL_fb3dfx.c @@ -21,7 +21,7 @@ */ #include "SDL_video.h" -#include "SDL_blit.h" +#include "../SDL_blit.h" #include "SDL_fb3dfx.h" #include "3dfx_mmio.h" diff --git a/src/video/fbcon/SDL_fbevents.c b/src/video/fbcon/SDL_fbevents.c index 9281687f..29a85dcc 100644 --- a/src/video/fbcon/SDL_fbevents.c +++ b/src/video/fbcon/SDL_fbevents.c @@ -41,9 +41,9 @@ #include "SDL_timer.h" #include "SDL_mutex.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_fbvideo.h" #include "SDL_fbevents_c.h" #include "SDL_fbkeys.h" @@ -316,13 +316,13 @@ static enum { void FB_CloseMouse(_THIS) { -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB if (ts_dev != NULL) { ts_close(ts_dev); ts_dev = NULL; mouse_fd = -1; } -#endif /* HAVE_TSLIB */ +#endif /* SDL_INPUT_TSLIB */ if ( mouse_fd > 0 ) { close(mouse_fd); } @@ -501,7 +501,7 @@ int FB_OpenMouse(_THIS) mousedev = SDL_getenv("SDL_MOUSEDEV"); mouse_fd = -1; -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB if ((mousedrv != NULL) && (SDL_strcmp(mousedrv, "TSLIB") == 0)) { if (mousedev == NULL) mousedev = SDL_getenv("TSLIB_TSDEVICE"); if (mousedev != NULL) { @@ -518,7 +518,7 @@ int FB_OpenMouse(_THIS) mouse_drv = MOUSE_NONE; return mouse_fd; } -#endif /* HAVE_TSLIB */ +#endif /* SDL_INPUT_TSLIB */ /* ELO TOUCHSCREEN SUPPORT */ @@ -663,7 +663,7 @@ void FB_vgamousecallback(int button, int relative, int dx, int dy) } /* Handle input from tslib */ -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB static void handle_tslib(_THIS) { struct ts_sample sample; @@ -676,7 +676,7 @@ static void handle_tslib(_THIS) } return; } -#endif /* HAVE_TSLIB */ +#endif /* SDL_INPUT_TSLIB */ /* For now, use MSC, PS/2, and MS protocols Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.) @@ -718,7 +718,7 @@ static void handle_mouse(_THIS) } return; /* nothing left to do */ case MOUSE_TSLIB: -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB handle_tslib(this); #endif return; /* nothing left to do */ diff --git a/src/video/fbcon/SDL_fbmatrox.c b/src/video/fbcon/SDL_fbmatrox.c index eaccee0e..78944886 100644 --- a/src/video/fbcon/SDL_fbmatrox.c +++ b/src/video/fbcon/SDL_fbmatrox.c @@ -21,7 +21,7 @@ */ #include "SDL_video.h" -#include "SDL_blit.h" +#include "../SDL_blit.h" #include "SDL_fbmatrox.h" #include "matrox_mmio.h" diff --git a/src/video/fbcon/SDL_fbmouse.c b/src/video/fbcon/SDL_fbmouse.c index ad00cee0..e4c2c87c 100644 --- a/src/video/fbcon/SDL_fbmouse.c +++ b/src/video/fbcon/SDL_fbmouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_fbvideo.h" #include "SDL_fbmouse_c.h" diff --git a/src/video/fbcon/SDL_fbriva.c b/src/video/fbcon/SDL_fbriva.c index c94a9cd8..e6432db3 100644 --- a/src/video/fbcon/SDL_fbriva.c +++ b/src/video/fbcon/SDL_fbriva.c @@ -21,7 +21,7 @@ */ #include "SDL_video.h" -#include "SDL_blit.h" +#include "../SDL_blit.h" #include "SDL_fbriva.h" #include "riva_mmio.h" #include "riva_regs.h" diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c index 1e24fd00..7a6a724e 100644 --- a/src/video/fbcon/SDL_fbvideo.c +++ b/src/video/fbcon/SDL_fbvideo.c @@ -33,9 +33,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_fbvideo.h" #include "SDL_fbmouse_c.h" #include "SDL_fbevents_c.h" @@ -432,7 +432,7 @@ static int cmpmodes(const void *va, const void *vb) return b->h - a->h; } -static int FB_SortModes(_THIS) +static void FB_SortModes(_THIS) { int i; for ( i=0; i<NUM_MODELISTS; ++i ) { @@ -464,7 +464,7 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat) return(-1); } -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED /* Create the hardware surface lock mutex */ hw_lock = SDL_CreateMutex(); if ( hw_lock == NULL ) { diff --git a/src/video/fbcon/SDL_fbvideo.h b/src/video/fbcon/SDL_fbvideo.h index 2f5bc6ca..bf74bbf5 100644 --- a/src/video/fbcon/SDL_fbvideo.h +++ b/src/video/fbcon/SDL_fbvideo.h @@ -29,8 +29,8 @@ #include "SDL_mouse.h" #include "SDL_mutex.h" -#include "SDL_sysvideo.h" -#ifdef HAVE_TSLIB +#include "../SDL_sysvideo.h" +#if SDL_INPUT_TSLIB #include "tslib.h" #endif @@ -63,7 +63,7 @@ struct SDL_PrivateVideoData { struct termios saved_kbd_termios; int mouse_fd; -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB struct tsdev *ts_dev; #endif @@ -96,9 +96,9 @@ struct SDL_PrivateVideoData { #define saved_kbd_mode (this->hidden->saved_kbd_mode) #define saved_kbd_termios (this->hidden->saved_kbd_termios) #define mouse_fd (this->hidden->mouse_fd) -#ifdef HAVE_TSLIB +#if SDL_INPUT_TSLIB #define ts_dev (this->hidden->ts_dev) -#endif /* HAVE_TSLIB */ +#endif #define cache_vinfo (this->hidden->cache_vinfo) #define saved_vinfo (this->hidden->saved_vinfo) #define saved_cmaplen (this->hidden->saved_cmaplen) diff --git a/src/video/gapi/Makefile.am b/src/video/gapi/Makefile.am deleted file mode 100644 index 005119d1..00000000 --- a/src/video/gapi/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -## Makefile.am for SDL using the PocketPC GAPI video driver - -noinst_LTLIBRARIES = libvideo_gapi.la -libvideo_gapi_la_SOURCES = $(GAPI_SRCS) - -# The SDL GAPI driver sources -GAPI_SRCS = \ - SDL_gapivideo.c \ - SDL_gapivideo.h diff --git a/src/video/gapi/SDL_gapivideo.c b/src/video/gapi/SDL_gapivideo.c index 460e8693..faad954d 100644 --- a/src/video/gapi/SDL_gapivideo.c +++ b/src/video/gapi/SDL_gapivideo.c @@ -34,9 +34,9 @@ Inspired by http://arisme.free.fr/ports/SDL.php #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_syswm_c.h" #include "SDL_sysmouse_c.h" diff --git a/src/video/gapi/SDL_gapivideo.h b/src/video/gapi/SDL_gapivideo.h index 75729b6c..d844fdec 100644 --- a/src/video/gapi/SDL_gapivideo.h +++ b/src/video/gapi/SDL_gapivideo.h @@ -24,8 +24,8 @@ #define _SDL_gapivideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" /* From gx.h, since it's not really C compliant */ diff --git a/src/video/gem/Makefile.am b/src/video/gem/Makefile.am deleted file mode 100644 index 0d96b8bf..00000000 --- a/src/video/gem/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -## Makefile.am for SDL using the GEM video driver - -noinst_LTLIBRARIES = libvideo_gem.la -libvideo_gem_la_SOURCES = $(GEM_SRCS) - -# The SDL GEM video driver sources -GEM_SRCS = \ - SDL_gemvideo.h \ - SDL_gemvideo.c \ - SDL_gemevents_c.h \ - SDL_gemevents.c \ - SDL_gemmouse_c.h \ - SDL_gemmouse.c \ - SDL_gemwm_c.h \ - SDL_gemwm.c diff --git a/src/video/gem/SDL_gemevents.c b/src/video/gem/SDL_gemevents.c index f6b9071e..fdfe2b1d 100644 --- a/src/video/gem/SDL_gemevents.c +++ b/src/video/gem/SDL_gemevents.c @@ -31,8 +31,8 @@ #include <gem.h> -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_gemvideo.h" #include "SDL_gemevents_c.h" #include "SDL_atarikeys.h" /* for keyboard scancodes */ diff --git a/src/video/gem/SDL_gemmouse.c b/src/video/gem/SDL_gemmouse.c index 937e4993..2b965a92 100644 --- a/src/video/gem/SDL_gemmouse.c +++ b/src/video/gem/SDL_gemmouse.c @@ -29,8 +29,8 @@ #include <gem.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_gemmouse_c.h" /* Defines */ diff --git a/src/video/gem/SDL_gemvideo.c b/src/video/gem/SDL_gemvideo.c index 3a6b8d33..683a377e 100644 --- a/src/video/gem/SDL_gemvideo.c +++ b/src/video/gem/SDL_gemvideo.c @@ -37,10 +37,10 @@ #include "SDL_endian.h" #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_ataric2p_s.h" #include "SDL_atarieddi_s.h" @@ -100,7 +100,7 @@ static void GEM_LockScreen(_THIS); static void GEM_UnlockScreen(_THIS); static void refresh_window(_THIS, int winhandle, short *rect); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* OpenGL functions */ static void GEM_GL_SwapBuffers(_THIS); #endif @@ -179,7 +179,7 @@ static SDL_VideoDevice *GEM_CreateDevice(int devindex) device->WarpWMCursor = NULL /*GEM_WarpWMCursor*/; device->CheckMouseMode = GEM_CheckMouseMode; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* OpenGL functions */ device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary; device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress; @@ -455,7 +455,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat) SDL_modelist[1] = NULL; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL SDL_AtariGL_InitPointers(this); #endif @@ -796,7 +796,7 @@ SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current, current->pitch = VDI_pitch; } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (flags & SDL_OPENGL) { if (!SDL_AtariGL_Init(this, current)) { GEM_FreeBuffers(this); @@ -1096,7 +1096,7 @@ void GEM_VideoQuit(_THIS) GEM_FreeBuffers(this); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (gl_active) { SDL_AtariGL_Quit(this, SDL_TRUE); } @@ -1318,7 +1318,7 @@ static void refresh_window(_THIS, int winhandle, short *rect) vro_cpyfm( VDI_handle, S_ONLY, pxy, &mfdb_src, &VDI_dst_mfdb); } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static void GEM_GL_SwapBuffers(_THIS) { diff --git a/src/video/gem/SDL_gemvideo.h b/src/video/gem/SDL_gemvideo.h index 3c6db4b1..9b91f25d 100644 --- a/src/video/gem/SDL_gemvideo.h +++ b/src/video/gem/SDL_gemvideo.h @@ -23,8 +23,8 @@ #ifndef _SDL_gemvideo_h #define _SDL_gemvideo_h -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ggi/Makefile.am b/src/video/ggi/Makefile.am deleted file mode 100644 index 8c07a1f4..00000000 --- a/src/video/ggi/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -## Makefile.am for SDL using the GGI video driver - -noinst_LTLIBRARIES = libvideo_ggi.la -libvideo_ggi_la_SOURCES = $(GGI_SRCS) -libvideo_ggi_la_LIBADD = -lggi -lgii -lgg - -# The SDL GGI video driver sources -GGI_SRCS = \ - SDL_ggikeys.h \ - SDL_ggivideo.h \ - SDL_ggievents.c \ - SDL_ggimouse.c \ - SDL_ggivideo.c \ - SDL_ggievents_c.h \ - SDL_ggimouse_c.h diff --git a/src/video/ggi/SDL_ggievents.c b/src/video/ggi/SDL_ggievents.c index dad7f3d0..b697ef4c 100644 --- a/src/video/ggi/SDL_ggievents.c +++ b/src/video/ggi/SDL_ggievents.c @@ -33,9 +33,9 @@ #include "SDL_ggikeys.h" #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_ggivideo.h" #include "SDL_ggievents_c.h" diff --git a/src/video/ggi/SDL_ggimouse.c b/src/video/ggi/SDL_ggimouse.c index c1cbbae0..0936c39b 100644 --- a/src/video/ggi/SDL_ggimouse.c +++ b/src/video/ggi/SDL_ggimouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ggimouse_c.h" diff --git a/src/video/ggi/SDL_ggivideo.c b/src/video/ggi/SDL_ggivideo.c index 51432de8..42456ad9 100644 --- a/src/video/ggi/SDL_ggivideo.c +++ b/src/video/ggi/SDL_ggivideo.c @@ -32,9 +32,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ggivideo.h" #include "SDL_ggimouse_c.h" #include "SDL_ggievents_c.h" diff --git a/src/video/ggi/SDL_ggivideo.h b/src/video/ggi/SDL_ggivideo.h index c3c31204..8a5ce216 100644 --- a/src/video/ggi/SDL_ggivideo.h +++ b/src/video/ggi/SDL_ggivideo.h @@ -26,7 +26,7 @@ #include <ggi/ggi.h> #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #define _THIS SDL_VideoDevice *this diff --git a/src/video/ipod/Makefile.am b/src/video/ipod/Makefile.am deleted file mode 100644 index 27b1a36d..00000000 --- a/src/video/ipod/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -## Makefile.am for SDL using the iPod framebuffer driver - -noinst_LTLIBRARIES = libvideo_ipod.la -libvideo_ipod_la_SOURCES = SDL_ipodvideo.c SDL_ipodvideo.h diff --git a/src/video/ipod/SDL_ipodvideo.c b/src/video/ipod/SDL_ipodvideo.c index 7810bf5a..a3f26a86 100644 --- a/src/video/ipod/SDL_ipodvideo.c +++ b/src/video/ipod/SDL_ipodvideo.c @@ -14,9 +14,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_sysevents.h" #include "SDL_ipodvideo.h" diff --git a/src/video/maccommon/Makefile.am b/src/video/maccommon/Makefile.am deleted file mode 100644 index 96395c57..00000000 --- a/src/video/maccommon/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -## Makefile.am for SDL using the MacOS toolbox - -noinst_LTLIBRARIES = libvideo_maccommon.la -libvideo_maccommon_la_SOURCES = $(COMMON_SRCS) - -# The SDL Mac toolbox driver sources -COMMON_SRCS = \ - SDL_lowvideo.h \ - SDL_macevents.c \ - SDL_macevents_c.h \ - SDL_macgl.c \ - SDL_macgl_c.h \ - SDL_mackeys.h \ - SDL_macmouse.c \ - SDL_macmouse_c.h \ - SDL_macwm.c \ - SDL_macwm_c.h diff --git a/src/video/maccommon/SDL_lowvideo.h b/src/video/maccommon/SDL_lowvideo.h index 23ed3cb9..d3f985be 100644 --- a/src/video/maccommon/SDL_lowvideo.h +++ b/src/video/maccommon/SDL_lowvideo.h @@ -34,7 +34,7 @@ #include <DrawSprocket.h> #endif -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #ifdef MACOSX #include <OpenGL/gl.h> /* OpenGL.framework */ #include <AGL/agl.h> /* AGL.framework */ @@ -42,10 +42,10 @@ #include <GL/gl.h> #include <agl.h> #endif /* MACOSX */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ #include "SDL_video.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this @@ -84,7 +84,7 @@ struct SDL_PrivateVideoData { /* Information used by DrawSprocket driver */ struct DSpInfo *dspinfo; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL AGLContext appleGLContext; void *libraryHandle; diff --git a/src/video/maccommon/SDL_macevents.c b/src/video/maccommon/SDL_macevents.c index c3fff52b..1c5ac9bd 100644 --- a/src/video/maccommon/SDL_macevents.c +++ b/src/video/maccommon/SDL_macevents.c @@ -37,9 +37,9 @@ #include "SDL_events.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" -#include "SDL_sysevents.h" +#include "../../events/SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../SDL_cursor_c.h" #include "SDL_macevents_c.h" #include "SDL_mackeys.h" #include "SDL_macmouse_c.h" @@ -380,7 +380,7 @@ static int Mac_HandleEvents(_THIS, int wait4it) #endif case updateEvt: { BeginUpdate(SDL_Window); - #ifdef HAVE_OPENGL + #if SDL_VIDEO_OPENGL if (SDL_VideoSurface->flags & SDL_OPENGL) SDL_GL_SwapBuffers(); else diff --git a/src/video/maccommon/SDL_macgl.c b/src/video/maccommon/SDL_macgl.c index e0ff3e9d..1eaa3261 100644 --- a/src/video/maccommon/SDL_macgl.c +++ b/src/video/maccommon/SDL_macgl.c @@ -30,7 +30,7 @@ /* krat: adding OpenGL support */ int Mac_GL_Init(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL AGLPixelFormat format; int i = 0; GLint attributes [ 24 ]; /* 24 is max possible in this setup */ @@ -121,7 +121,7 @@ int Mac_GL_Init(_THIS) void Mac_GL_Quit(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ( glContext != NULL ) { aglSetCurrentContext(NULL); aglSetDrawable(glContext, NULL); @@ -131,7 +131,7 @@ void Mac_GL_Quit(_THIS) #endif } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Make the current context active */ int Mac_GL_MakeCurrent(_THIS) @@ -175,5 +175,5 @@ void* Mac_GL_GetProcAddress(_THIS, const char *proc) return SDL_LoadFunction( this->hidden->libraryHandle, proc ); } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ diff --git a/src/video/maccommon/SDL_macgl_c.h b/src/video/maccommon/SDL_macgl_c.h index 4f5d612c..a5393856 100644 --- a/src/video/maccommon/SDL_macgl_c.h +++ b/src/video/maccommon/SDL_macgl_c.h @@ -22,7 +22,7 @@ /* AGL implementation of SDL OpenGL support */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #ifdef MACOSX #include <OpenGL/gl.h> /* OpenGL.framework */ #include <AGL/agl.h> /* AGL.framework */ @@ -30,12 +30,12 @@ #include <GL/gl.h> #include <agl.h> #endif /* MACOSX */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ /* OpenGL functions */ extern int Mac_GL_Init(_THIS); extern void Mac_GL_Quit(_THIS); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL extern int Mac_GL_MakeCurrent(_THIS); extern int Mac_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void Mac_GL_SwapBuffers(_THIS); diff --git a/src/video/macdsp/Makefile.am b/src/video/macdsp/Makefile.am deleted file mode 100644 index 2cfdf842..00000000 --- a/src/video/macdsp/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -## Makefile.am for SDL using the Mac DrawSprocket video driver - -noinst_LTLIBRARIES = libvideo_macdsp.la -libvideo_macdsp_la_SOURCES = $(DSP_SRCS) - -# The SDL Mac DrawSprocket driver sources -DSP_SRCS = \ - SDL_dspvideo.c \ - SDL_dspvideo.h diff --git a/src/video/macdsp/SDL_dspvideo.c b/src/video/macdsp/SDL_dspvideo.c index a502c04a..7807043c 100644 --- a/src/video/macdsp/SDL_dspvideo.c +++ b/src/video/macdsp/SDL_dspvideo.c @@ -138,10 +138,10 @@ #endif #include "SDL_video.h" -#include "SDL_blit.h" #include "SDL_syswm.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_blit.h" +#include "../SDL_pixels_c.h" #include "SDL_dspvideo.h" #include "SDL_macgl_c.h" #include "SDL_macwm_c.h" @@ -177,7 +177,7 @@ static int DSp_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); static int DSp_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static void DSp_GL_SwapBuffers (_THIS); #endif @@ -296,7 +296,7 @@ static SDL_VideoDevice *DSp_CreateDevice(int devindex) device->UnlockHWSurface = DSp_UnlockHWSurface; device->FlipHWSurface = DSp_FlipHWSurface; device->FreeHWSurface = DSp_FreeHWSurface; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_MakeCurrent = Mac_GL_MakeCurrent; device->GL_SwapBuffers = DSp_GL_SwapBuffers; device->GL_LoadLibrary = Mac_GL_LoadLibrary; @@ -1390,7 +1390,7 @@ void DSp_VideoQuit(_THIS) DSpShutdown (); } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* swap buffers with v-sync */ static void DSp_GL_SwapBuffers (_THIS) { diff --git a/src/video/macrom/Makefile.am b/src/video/macrom/Makefile.am deleted file mode 100644 index e2124b25..00000000 --- a/src/video/macrom/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -## Makefile.am for SDL using the Mac toolbox video driver - -noinst_LTLIBRARIES = libvideo_macrom.la -libvideo_macrom_la_SOURCES = $(ROM_SRCS) - -# The SDL Mac toolbox driver sources -ROM_SRCS = \ - SDL_romvideo.c \ - SDL_romvideo.h diff --git a/src/video/macrom/SDL_romvideo.c b/src/video/macrom/SDL_romvideo.c index 6835751d..27d159fa 100644 --- a/src/video/macrom/SDL_romvideo.c +++ b/src/video/macrom/SDL_romvideo.c @@ -43,7 +43,7 @@ #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #include "SDL_romvideo.h" #include "SDL_macgl_c.h" #include "SDL_macwm_c.h" @@ -156,7 +156,7 @@ static SDL_VideoDevice *ROM_CreateDevice(int devindex) device->UnlockHWSurface = ROM_UnlockHWSurface; device->FlipHWSurface = NULL; device->FreeHWSurface = ROM_FreeHWSurface; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_MakeCurrent = Mac_GL_MakeCurrent; device->GL_SwapBuffers = Mac_GL_SwapBuffers; device->GL_LoadLibrary = Mac_GL_LoadLibrary; diff --git a/src/video/math_private.h b/src/video/math_private.h index c7cf051f..1339ef0c 100644 --- a/src/video/math_private.h +++ b/src/video/math_private.h @@ -20,10 +20,7 @@ #include "SDL_endian.h" #define huge really_big /* huge is a reserved keyword in VC++ 6.0 */ -#define int32_t math_int32_t -#define u_int32_t math_u_int32_t -typedef Sint32 math_int32_t; -typedef Uint32 math_u_int32_t; +#define u_int32_t uint32_t /* The original fdlibm code used statements like: n0 = ((*(int*)&one)>>29)^1; * index of high word * diff --git a/src/video/nanox/Makefile.am b/src/video/nanox/Makefile.am deleted file mode 100644 index 70c41e36..00000000 --- a/src/video/nanox/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -## Makefile.am for SDL using the nanox video driver - -noinst_LTLIBRARIES = libvideo_nanox.la -libvideo_nanox_la_SOURCES = $(NANOX_SRCS) - -# The SDL nanox video driver sources -NANOX_SRCS = \ - SDL_nxmodes.c \ - SDL_nxmodes_c.h \ - SDL_nxmouse.c \ - SDL_nxmouse_c.h \ - SDL_nxvideo.c \ - SDL_nxvideo.h \ - SDL_nxwm.c \ - SDL_nxwm_c.h \ - SDL_nxevents.c \ - SDL_nxevents_c.h \ - SDL_nximage.c \ - SDL_nximage_c.h diff --git a/src/video/nanox/SDL_nxevents.c b/src/video/nanox/SDL_nxevents.c index 39d62483..09bc7fdb 100644 --- a/src/video/nanox/SDL_nxevents.c +++ b/src/video/nanox/SDL_nxevents.c @@ -26,7 +26,7 @@ */ #include "SDL_keysym.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_nxevents_c.h" #include "SDL_nximage_c.h" diff --git a/src/video/nanox/SDL_nxmouse.c b/src/video/nanox/SDL_nxmouse.c index 08fae2d4..db4f5e23 100644 --- a/src/video/nanox/SDL_nxmouse.c +++ b/src/video/nanox/SDL_nxmouse.c @@ -24,7 +24,7 @@ clare@setabox.com */ -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_nxmouse_c.h" diff --git a/src/video/nanox/SDL_nxvideo.c b/src/video/nanox/SDL_nxvideo.c index 5069d33b..1df3fb8c 100644 --- a/src/video/nanox/SDL_nxvideo.c +++ b/src/video/nanox/SDL_nxvideo.c @@ -27,8 +27,8 @@ #include "SDL_thread.h" #include "SDL_video.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #define MWINCLUDECOLORS #include "SDL_nxvideo.h" @@ -119,7 +119,7 @@ static SDL_VideoDevice * NX_CreateDevice (int devindex) device -> SetGammaRamp = NX_SetGammaRamp ; device -> GetGammaRamp = NX_GetGammaRamp ; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device -> GL_LoadLibrary = NULL ; device -> GL_GetProcAddress = NULL ; device -> GL_GetAttribute = NULL ; diff --git a/src/video/nanox/SDL_nxvideo.h b/src/video/nanox/SDL_nxvideo.h index 120e9d33..e55566a2 100644 --- a/src/video/nanox/SDL_nxvideo.h +++ b/src/video/nanox/SDL_nxvideo.h @@ -29,7 +29,7 @@ #include <microwin/nano-X.h> -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #ifdef ENABLE_NANOX_DEBUG #define Dprintf printf diff --git a/src/video/nanox/SDL_nxwm.c b/src/video/nanox/SDL_nxwm.c index 65a6c41b..2438856c 100644 --- a/src/video/nanox/SDL_nxwm.c +++ b/src/video/nanox/SDL_nxwm.c @@ -25,7 +25,7 @@ */ #include "SDL_syswm.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_nxwm_c.h" diff --git a/src/video/os2fslib/Makefile.am b/src/video/os2fslib/Makefile.am deleted file mode 100644 index 6a1dde77..00000000 --- a/src/video/os2fslib/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -## Makefile.am for SDL using the os2fslib video driver - -noinst_LTLIBRARIES = libvideo_os2fslib.la -libvideo_os2fslib_la_SOURCES = $(OS2FSLIB_SRCS) - -# The SDL os2fslib driver sources -OS2FSLIB_SRCS = \ - SDL_os2fslib.c \ - SDL_os2fslib.h \ - SDL_vkeys.h diff --git a/src/video/os2fslib/SDL_os2fslib.c b/src/video/os2fslib/SDL_os2fslib.c index d98baa86..89f06e39 100644 --- a/src/video/os2fslib/SDL_os2fslib.c +++ b/src/video/os2fslib/SDL_os2fslib.c @@ -25,9 +25,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_os2fslib.h" diff --git a/src/video/photon/Makefile.am b/src/video/photon/Makefile.am deleted file mode 100644 index caa22ea4..00000000 --- a/src/video/photon/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ - -## Makefile.am for SDL using the QNX Photon video driver - -noinst_LTLIBRARIES = libvideo_photon.la -libvideo_photon_la_SOURCES = $(PH_SRCS) - -# The SDL QNX Photon video driver sources -PH_SRCS = \ - SDL_ph_events.c \ - SDL_ph_events_c.h \ - SDL_ph_image.c \ - SDL_ph_image_c.h \ - SDL_ph_modes.c \ - SDL_ph_modes_c.h \ - SDL_ph_mouse.c \ - SDL_ph_mouse_c.h \ - SDL_ph_video.c \ - SDL_ph_video.h \ - SDL_ph_gl.c \ - SDL_ph_gl.h \ - SDL_ph_wm.c \ - SDL_ph_wm_c.h \ - SDL_phyuv.c \ - SDL_phyuv_c.h diff --git a/src/video/photon/SDL_ph_events.c b/src/video/photon/SDL_ph_events.c index c514f6fd..d570e29f 100644 --- a/src/video/photon/SDL_ph_events.c +++ b/src/video/photon/SDL_ph_events.c @@ -22,8 +22,6 @@ /* Handle the event stream, converting photon events into SDL events */ -#define DISABLE_X11 - #include <stdio.h> #include <setjmp.h> #include <sys/time.h> @@ -33,9 +31,9 @@ #include "SDL.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_ph_video.h" #include "SDL_ph_modes_c.h" #include "SDL_ph_image_c.h" diff --git a/src/video/photon/SDL_ph_gl.c b/src/video/photon/SDL_ph_gl.c index 301487f8..35a6b314 100644 --- a/src/video/photon/SDL_ph_gl.c +++ b/src/video/photon/SDL_ph_gl.c @@ -24,7 +24,7 @@ #include "SDL.h" #include "SDL_ph_gl.h" -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #if (_NTO_VERSION >= 630) /* PhotonGL functions */ @@ -96,7 +96,7 @@ int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) #if (_NTO_VERSION < 630) int ph_GL_LoadLibrary(_THIS, const char* path) { - /* if code compiled with HAVE_OPENGL, that mean that library already linked */ + /* if code compiled with SDL_VIDEO_OPENGL, that mean that library already linked */ this->gl_config.driver_loaded = 1; return 0; @@ -402,4 +402,4 @@ int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags) #endif /* _NTO_VERSION */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ diff --git a/src/video/photon/SDL_ph_gl.h b/src/video/photon/SDL_ph_gl.h index ebbe5850..50d04397 100644 --- a/src/video/photon/SDL_ph_gl.h +++ b/src/video/photon/SDL_ph_gl.h @@ -27,7 +27,7 @@ #define DEFAULT_OPENGL "/usr/lib/libGL.so" -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL void ph_GL_SwapBuffers(_THIS); int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); int ph_GL_LoadLibrary(_THIS, const char* path); @@ -35,6 +35,6 @@ int ph_GL_MakeCurrent(_THIS); int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags); -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ #endif /* __SDL_PH_GL_H__ */ diff --git a/src/video/photon/SDL_ph_image.c b/src/video/photon/SDL_ph_image.c index 1429c41e..d50a9050 100644 --- a/src/video/photon/SDL_ph_image.c +++ b/src/video/photon/SDL_ph_image.c @@ -25,7 +25,7 @@ #include "SDL_endian.h" #include "SDL_video.h" -#include "SDL_pixels_c.h" +#include "../SDL_pixels_c.h" #include "SDL_ph_video.h" #include "SDL_ph_image_c.h" #include "SDL_ph_modes_c.h" @@ -293,7 +293,7 @@ int ph_SetupFullScreenImage(_THIS, SDL_Surface* screen) return 0; } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen) { @@ -321,12 +321,12 @@ int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen) return 0; } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ void ph_DestroyImage(_THIS, SDL_Surface* screen) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ((screen->flags & SDL_OPENGL)==SDL_OPENGL) { if (oglctx) @@ -354,7 +354,7 @@ void ph_DestroyImage(_THIS, SDL_Surface* screen) return; } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ if (currently_fullscreen) { @@ -484,14 +484,14 @@ int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags) ph_DestroyImage(this, screen); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if ((flags & SDL_OPENGL)==SDL_OPENGL) { setupresult=ph_SetupOpenGLImage(this, screen); } else { -#endif /* HAVE_OPENGL */ +#endif if ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN) { setupresult=ph_SetupFullScreenImage(this, screen); @@ -507,9 +507,9 @@ int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags) setupresult=ph_SetupImage(this, screen); } } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL } -#endif /* HAVE_OPENGL */ +#endif if (setupresult!=-1) { ph_UpdateHWInfo(this); @@ -954,14 +954,14 @@ int ph_SetHWAlpha(_THIS, SDL_Surface* surface, Uint8 alpha) return 0; } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects) { this->GL_SwapBuffers(this); return; } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) { diff --git a/src/video/photon/SDL_ph_image_c.h b/src/video/photon/SDL_ph_image_c.h index 063879b3..f38ded7c 100644 --- a/src/video/photon/SDL_ph_image_c.h +++ b/src/video/photon/SDL_ph_image_c.h @@ -23,7 +23,7 @@ #ifndef __SDL_PH_IMAGE_H__ #define __SDL_PH_IMAGE_H__ -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ph_video.h" struct private_hwdata diff --git a/src/video/photon/SDL_ph_modes.c b/src/video/photon/SDL_ph_modes.c index dafca2d9..2ae25a0c 100644 --- a/src/video/photon/SDL_ph_modes.c +++ b/src/video/photon/SDL_ph_modes.c @@ -310,13 +310,9 @@ int ph_EnterFullScreen(_THIS, SDL_Surface* screen, int fmode) { if ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL) { -#ifdef HAVE_OPENGL - #if (_NTO_VERSION < 630) - return 0; - #endif /* 6.3.0 */ -#else - return 0; -#endif /* HAVE_OPENGL */ +#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630) + return 0; /* 6.3.0 */ +#endif } } @@ -350,13 +346,9 @@ int ph_LeaveFullScreen(_THIS) { if ((this->screen) && ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL)) { -#ifdef HAVE_OPENGL - #if (_NTO_VERSION < 630) - return 0; - #endif /* 6.3.0 */ -#else +#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630) return 0; -#endif /* HAVE_OPENGL */ +#endif } /* release routines starts here */ diff --git a/src/video/photon/SDL_ph_mouse.c b/src/video/photon/SDL_ph_mouse.c index 4e1141f6..0c9ac5f7 100644 --- a/src/video/photon/SDL_ph_mouse.c +++ b/src/video/photon/SDL_ph_mouse.c @@ -21,8 +21,8 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_ph_mouse_c.h" struct WMcursor diff --git a/src/video/photon/SDL_ph_video.c b/src/video/photon/SDL_ph_video.c index 02707744..49dd10db 100644 --- a/src/video/photon/SDL_ph_video.c +++ b/src/video/photon/SDL_ph_video.c @@ -28,9 +28,9 @@ #include "SDL_thread.h" #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ph_video.h" #include "SDL_ph_modes_c.h" #include "SDL_ph_image_c.h" @@ -39,7 +39,7 @@ #include "SDL_ph_wm_c.h" #include "SDL_ph_gl.h" #include "SDL_phyuv_c.h" -#include "blank_cursor.h" +#include "../blank_cursor.h" static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat); static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); @@ -123,19 +123,13 @@ static SDL_VideoDevice* ph_CreateDevice(int devindex) device->PumpEvents = ph_PumpEvents; /* OpenGL support. */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_MakeCurrent = ph_GL_MakeCurrent; device->GL_SwapBuffers = ph_GL_SwapBuffers; device->GL_GetAttribute = ph_GL_GetAttribute; device->GL_LoadLibrary = ph_GL_LoadLibrary; device->GL_GetProcAddress = ph_GL_GetProcAddress; -#else - device->GL_MakeCurrent = NULL; - device->GL_SwapBuffers = NULL; - device->GL_GetAttribute = NULL; - device->GL_LoadLibrary = NULL; - device->GL_GetProcAddress = NULL; -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ device->free = ph_DeleteDevice; @@ -357,12 +351,12 @@ static int ph_VideoInit(_THIS, SDL_PixelFormat* vformat) window=NULL; desktoppal=SDLPH_PAL_NONE; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL oglctx=NULL; oglbuffers=NULL; oglflags=0; oglbpp=0; -#endif /* HAVE_OPENGL */ +#endif old_video_mode=-1; old_refresh_rate=-1; @@ -478,12 +472,12 @@ static SDL_Surface* ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int if ((current->flags & SDL_OPENGL)==SDL_OPENGL) { -#if !defined(HAVE_OPENGL) +#if !SDL_VIDEO_OPENGL /* if no built-in OpenGL support */ SDL_SetError("ph_SetVideoMode(): no OpenGL support, you need to recompile SDL.\n"); current->flags &= ~SDL_OPENGL; return NULL; -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ } else { diff --git a/src/video/photon/SDL_ph_video.h b/src/video/photon/SDL_ph_video.h index c40df59f..ed389173 100644 --- a/src/video/photon/SDL_ph_video.h +++ b/src/video/photon/SDL_ph_video.h @@ -24,7 +24,7 @@ #define __SDL_PH_VIDEO_H__ #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" #include <sys/neutrino.h> @@ -33,14 +33,14 @@ #include <photon/Pg.h> #include <photon/PdDirect.h> -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #if (_NTO_VERSION < 630) #include <photon/PdGL.h> #else #include <GL/qnxgl.h> #include <GL/GLPh.h> #endif /* 6.3.0 */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice* this @@ -74,7 +74,7 @@ struct SDL_PrivateVideoData PgDisplaySettings_t mode_settings; PtWidget_t *Window; /* used to handle input events */ PhImage_t *image; /* used to display image */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #if (_NTO_VERSION < 630) PdOpenGLContext_t* OGLContext; /* OpenGL context */ void* OGLBuffers; /* OpenGL buffers (unused) */ @@ -85,7 +85,7 @@ struct SDL_PrivateVideoData Uint32 OGLFlags; /* OpenGL flags */ Uint32 OGLBPP; /* OpenGL bpp */ -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ PgColor_t savedpal[_Pg_MAX_PALETTE]; PgColor_t syspalph[_Pg_MAX_PALETTE]; @@ -146,11 +146,11 @@ struct SDL_PrivateVideoData #define SDL_BlankCursor (this->hidden->BlankCursor) #define videomode_emulatemode (this->hidden->videomode_emulatemode) -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #define oglctx (this->hidden->OGLContext) #define oglbuffers (this->hidden->OGLBuffers) #define oglflags (this->hidden->OGLFlags) #define oglbpp (this->hidden->OGLBPP) -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ #endif /* __SDL_PH_VIDEO_H__ */ diff --git a/src/video/photon/SDL_ph_wm.c b/src/video/photon/SDL_ph_wm.c index 4610f3fc..a3bcc7f3 100644 --- a/src/video/photon/SDL_ph_wm.c +++ b/src/video/photon/SDL_ph_wm.c @@ -20,8 +20,6 @@ slouken@libsdl.org */ -#define DISABLE_X11 - #include <Ph.h> #include <photon/PpProto.h> #include <photon/PhWm.h> @@ -31,8 +29,8 @@ #include "SDL_timer.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_events_c.h" -#include "SDL_pixels_c.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ph_modes_c.h" #include "SDL_ph_wm_c.h" diff --git a/src/video/photon/SDL_phyuv.c b/src/video/photon/SDL_phyuv.c index f70371aa..87e7f434 100644 --- a/src/video/photon/SDL_phyuv.c +++ b/src/video/photon/SDL_phyuv.c @@ -29,7 +29,7 @@ #include "SDL_video.h" #include "SDL_phyuv_c.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" #define OVERLAY_STATE_UNINIT 0 #define OVERLAY_STATE_ACTIVE 1 diff --git a/src/video/picogui/Makefile.am b/src/video/picogui/Makefile.am deleted file mode 100644 index fd037ded..00000000 --- a/src/video/picogui/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -## Makefile.am for SDL using the PicoGUI video driver - -noinst_LTLIBRARIES = libvideo_picogui.la -libvideo_picogui_la_SOURCES = $(PICOGUI_SRCS) - -# The SDL PicoGUI video driver sources -PICOGUI_SRCS = \ - SDL_pgevents.c \ - SDL_pgevents_c.h \ - SDL_pgvideo.c \ - SDL_pgvideo.h - diff --git a/src/video/picogui/SDL_pgevents.c b/src/video/picogui/SDL_pgevents.c index aaec24b2..99806854 100644 --- a/src/video/picogui/SDL_pgevents.c +++ b/src/video/picogui/SDL_pgevents.c @@ -24,8 +24,8 @@ */ #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_pgvideo.h" #include "SDL_pgevents_c.h" diff --git a/src/video/picogui/SDL_pgvideo.c b/src/video/picogui/SDL_pgvideo.c index 94190819..b14025c7 100644 --- a/src/video/picogui/SDL_pgvideo.c +++ b/src/video/picogui/SDL_pgvideo.c @@ -25,9 +25,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_pgvideo.h" #include "SDL_pgevents_c.h" diff --git a/src/video/picogui/SDL_pgvideo.h b/src/video/picogui/SDL_pgvideo.h index 670b9871..f5113d8f 100644 --- a/src/video/picogui/SDL_pgvideo.h +++ b/src/video/picogui/SDL_pgvideo.h @@ -27,8 +27,8 @@ #define _SDL_pgvideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" #include <picogui.h> #include <sys/shm.h> diff --git a/src/video/ps2gs/Makefile.am b/src/video/ps2gs/Makefile.am deleted file mode 100644 index 8632d37a..00000000 --- a/src/video/ps2gs/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -## Makefile.am for SDL using the framebuffer console video driver - -noinst_LTLIBRARIES = libvideo_ps2gs.la -libvideo_ps2gs_la_SOURCES = $(PS2GS_SRCS) - -# The SDL framebuffer console video driver sources -PS2GS_SRCS = \ - SDL_gsevents.c \ - SDL_gsevents_c.h \ - SDL_gskeys.h \ - SDL_gsmouse.c \ - SDL_gsmouse_c.h \ - SDL_gsvideo.c \ - SDL_gsvideo.h \ - SDL_gsyuv.c \ - SDL_gsyuv_c.h diff --git a/src/video/ps2gs/SDL_gsevents.c b/src/video/ps2gs/SDL_gsevents.c index acaef94c..89b5b89f 100644 --- a/src/video/ps2gs/SDL_gsevents.c +++ b/src/video/ps2gs/SDL_gsevents.c @@ -39,9 +39,9 @@ #include <linux/keyboard.h> #include "SDL_mutex.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_gsvideo.h" #include "SDL_gsevents_c.h" #include "SDL_gskeys.h" diff --git a/src/video/ps2gs/SDL_gsmouse.c b/src/video/ps2gs/SDL_gsmouse.c index c359a85f..364d8623 100644 --- a/src/video/ps2gs/SDL_gsmouse.c +++ b/src/video/ps2gs/SDL_gsmouse.c @@ -23,8 +23,8 @@ #include <sys/ioctl.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_gsvideo.h" #include "SDL_gsmouse_c.h" diff --git a/src/video/ps2gs/SDL_gsvideo.c b/src/video/ps2gs/SDL_gsvideo.c index 26f697c2..2d1b251a 100644 --- a/src/video/ps2gs/SDL_gsvideo.c +++ b/src/video/ps2gs/SDL_gsvideo.c @@ -30,10 +30,10 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_gsvideo.h" #include "SDL_gsmouse_c.h" #include "SDL_gsevents_c.h" diff --git a/src/video/ps2gs/SDL_gsvideo.h b/src/video/ps2gs/SDL_gsvideo.h index 154930fd..13715013 100644 --- a/src/video/ps2gs/SDL_gsvideo.h +++ b/src/video/ps2gs/SDL_gsvideo.h @@ -30,7 +30,7 @@ #include "SDL_mouse.h" #include "SDL_mutex.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/ps2gs/SDL_gsyuv.c b/src/video/ps2gs/SDL_gsyuv.c index 7959a4dc..33c71889 100644 --- a/src/video/ps2gs/SDL_gsyuv.c +++ b/src/video/ps2gs/SDL_gsyuv.c @@ -30,7 +30,7 @@ #include "SDL_video.h" #include "SDL_gsyuv_c.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" /* The maximum number of 16x16 pixel block converted at once */ #define MAX_MACROBLOCKS 1024 /* 2^10 macroblocks at once */ diff --git a/src/video/qtopia/Makefile.am b/src/video/qtopia/Makefile.am deleted file mode 100644 index 09b0fb33..00000000 --- a/src/video/qtopia/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -## Makefile.am for SDL using the Qtopia backend - -noinst_LTLIBRARIES = libvideo_qtopia.la -libvideo_qtopia_la_SOURCES = $(QTOPIA_SRCS) - -# The SDL BWindow video driver sources -QTOPIA_SRCS = \ - SDL_QWin.h \ - SDL_QWin.cc \ - SDL_lowvideo.h \ - SDL_sysmouse.cc \ - SDL_sysmouse_c.h \ - SDL_sysvideo.cc \ - SDL_syswm.cc \ - SDL_syswm_c.h \ - SDL_sysevents.cc \ - SDL_sysevents_c.h diff --git a/src/video/qtopia/SDL_QWin.h b/src/video/qtopia/SDL_QWin.h index 9b6a89c0..8d5e7e09 100644 --- a/src/video/qtopia/SDL_QWin.h +++ b/src/video/qtopia/SDL_QWin.h @@ -34,7 +34,7 @@ #include "SDL_events.h" extern "C" { -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" }; typedef enum { diff --git a/src/video/qtopia/SDL_lowvideo.h b/src/video/qtopia/SDL_lowvideo.h index 0da45ffc..032cd2fb 100644 --- a/src/video/qtopia/SDL_lowvideo.h +++ b/src/video/qtopia/SDL_lowvideo.h @@ -24,7 +24,7 @@ #define _SDL_lowvideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *_this diff --git a/src/video/qtopia/SDL_sysevents.cc b/src/video/qtopia/SDL_sysevents.cc index 60599623..deb8497e 100644 --- a/src/video/qtopia/SDL_sysevents.cc +++ b/src/video/qtopia/SDL_sysevents.cc @@ -31,8 +31,8 @@ #include "SDL_timer.h" extern "C" { -#include "SDL_events_c.h" -#include "SDL_sysevents.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_sysevents_c.h" // static SDLKey keymap[128]; diff --git a/src/video/qtopia/SDL_sysvideo.cc b/src/video/qtopia/SDL_sysvideo.cc index 8a7e2912..dfdbad3b 100644 --- a/src/video/qtopia/SDL_sysvideo.cc +++ b/src/video/qtopia/SDL_sysvideo.cc @@ -33,10 +33,10 @@ extern "C" { -#include "SDL_sysvideo.h" -#include "SDL_sysmouse_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_events_c.h" #include "SDL_sysevents_c.h" -#include "SDL_events_c.h" +#include "SDL_sysmouse_c.h" #include "SDL_syswm_c.h" #include "SDL_lowvideo.h" diff --git a/src/video/quartz/Makefile.am b/src/video/quartz/Makefile.am deleted file mode 100644 index 40542b87..00000000 --- a/src/video/quartz/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -## Makefile.am for SDL using the MacOS X Quartz video driver - -noinst_LTLIBRARIES = libvideo_quartz.la -libvideo_quartz_la_SOURCES = $(QUARTZ_SRCS) - -# The SDL MacOS X Quartz video driver sources -QUARTZ_SRCS = \ - CGS.h \ - SDL_QuartzEvents.m \ - SDL_QuartzGL.m \ - SDL_QuartzKeys.h \ - SDL_QuartzVideo.h \ - SDL_QuartzVideo.m \ - SDL_QuartzWindow.h \ - SDL_QuartzWindow.m \ - SDL_QuartzWM.m \ - SDL_QuartzYUV.m diff --git a/src/video/quartz/SDL_QuartzVideo.h b/src/video/quartz/SDL_QuartzVideo.h index b63b9af0..4c0b2de7 100644 --- a/src/video/quartz/SDL_QuartzVideo.h +++ b/src/video/quartz/SDL_QuartzVideo.h @@ -60,11 +60,11 @@ #include "SDL_video.h" #include "SDL_error.h" #include "SDL_timer.h" -#include "SDL_syswm.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" #include "SDL_loadso.h" +#include "SDL_syswm.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" /* This is a workaround to directly access NSOpenGLContext's CGL context diff --git a/src/video/quartz/SDL_QuartzYUV.m b/src/video/quartz/SDL_QuartzYUV.m index 3943a6f1..610a49a2 100644 --- a/src/video/quartz/SDL_QuartzYUV.m +++ b/src/video/quartz/SDL_QuartzYUV.m @@ -22,7 +22,7 @@ #include "SDL_QuartzVideo.h" #include "SDL_QuartzWindow.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" #define yuv_idh (this->hidden->yuv_idh) diff --git a/src/video/riscos/Makefile.am b/src/video/riscos/Makefile.am deleted file mode 100644 index 4b7217fc..00000000 --- a/src/video/riscos/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ - -## Makefile.am for SDL using the RISC OS video driver - -noinst_LTLIBRARIES = libvideo_riscos.la -libvideo_riscos_la_SOURCES = $(CGX_SRCS) - -# The SDL RISC OS video driver sources -CGX_SRCS = \ - SDL_riscosASM.s \ - SDL_riscosevents.c \ - SDL_riscosevents_c.h \ - SDL_riscosFullScreenVideo.c \ - SDL_riscosmouse.c \ - SDL_riscosmouse_c.h \ - SDL_riscossprite.c \ - SDL_riscostask.c \ - SDL_riscostask.h \ - SDL_riscosvideo.c \ - SDL_riscosvideo.h \ - SDL_wimppoll.c \ - SDL_wimpvideo.c diff --git a/src/video/riscos/SDL_riscosFullScreenVideo.c b/src/video/riscos/SDL_riscosFullScreenVideo.c index f64f34a6..aa19ccd4 100644 --- a/src/video/riscos/SDL_riscosFullScreenVideo.c +++ b/src/video/riscos/SDL_riscosFullScreenVideo.c @@ -29,9 +29,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_riscostask.h" #include "SDL_riscosvideo.h" diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c index e2bb8a4c..ed76b9a7 100644 --- a/src/video/riscos/SDL_riscosevents.c +++ b/src/video/riscos/SDL_riscosevents.c @@ -29,12 +29,12 @@ #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../timer/SDL_timer_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_riscosvideo.h" #include "SDL_riscosevents_c.h" -#include "SDL_timer_c.h" -#include "SDL_cursor_c.h" #include "memory.h" #include "stdlib.h" @@ -76,7 +76,7 @@ void RISCOS_PollKeyboard(); void RISCOS_PollMouseHelper(_THIS, int fullscreen); -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED extern void DRenderer_FillBuffers(); /* Timer running function */ @@ -89,7 +89,7 @@ void FULLSCREEN_PumpEvents(_THIS) /* Current implementation requires keyboard and mouse polling */ RISCOS_PollKeyboard(); RISCOS_PollMouse(this); -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED // DRenderer_FillBuffers(); if (SDL_timer_running) RISCOS_CheckTimer(); #endif diff --git a/src/video/riscos/SDL_riscosmouse.c b/src/video/riscos/SDL_riscosmouse.c index 2ea96dee..705d57cb 100644 --- a/src/video/riscos/SDL_riscosmouse.c +++ b/src/video/riscos/SDL_riscosmouse.c @@ -28,7 +28,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_riscosmouse_c.h" diff --git a/src/video/riscos/SDL_riscostask.c b/src/video/riscos/SDL_riscostask.c index c5d72a0c..c09a7a43 100644 --- a/src/video/riscos/SDL_riscostask.c +++ b/src/video/riscos/SDL_riscostask.c @@ -37,7 +37,7 @@ #include "SDL_stdinc.h" #include "SDL_riscostask.h" -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED #include <pthread.h> pthread_t main_thread; #endif @@ -110,7 +110,7 @@ int RISCOS_InitTask() return 1; } -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED main_thread = pthread_self(); #endif diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c index 9f2872d1..884f31d3 100644 --- a/src/video/riscos/SDL_riscosvideo.c +++ b/src/video/riscos/SDL_riscosvideo.c @@ -32,9 +32,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" #include "SDL_syswm.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_riscostask.h" #include "SDL_riscosvideo.h" diff --git a/src/video/riscos/SDL_riscosvideo.h b/src/video/riscos/SDL_riscosvideo.h index 9a74a862..f9710a7d 100644 --- a/src/video/riscos/SDL_riscosvideo.h +++ b/src/video/riscos/SDL_riscosvideo.h @@ -24,8 +24,8 @@ #define _SDL_riscosvideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/riscos/SDL_wimppoll.c b/src/video/riscos/SDL_wimppoll.c index 99a5092d..b7bd3e54 100644 --- a/src/video/riscos/SDL_wimppoll.c +++ b/src/video/riscos/SDL_wimppoll.c @@ -29,8 +29,8 @@ #include "SDL.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_riscosvideo.h" #include "SDL_riscosevents_c.h" #include "SDL_riscosmouse_c.h" @@ -44,7 +44,7 @@ #include "swis.h" #include "unixlib/os.h" -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED #include <pthread.h> #endif @@ -61,10 +61,9 @@ void WIMP_PaletteChanged(_THIS); extern void WIMP_PollMouse(_THIS); extern void RISCOS_PollKeyboard(); -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED /* Timer running function */ extern void RISCOS_CheckTimer(); - #else extern int riscos_using_threads; #endif @@ -84,7 +83,7 @@ void WIMP_PumpEvents(_THIS) WIMP_Poll(this, 0); if (hasFocus) RISCOS_PollKeyboard(); if (mouseInWindow) WIMP_PollMouse(this); -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED if (SDL_timer_running) RISCOS_CheckTimer(); #endif } @@ -110,7 +109,7 @@ void WIMP_Poll(_THIS, int waitTime) while (doPoll) { -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED /* Stop thread callbacks while program is paged out */ if (riscos_using_threads) __pthread_stop_ticker(); #endif @@ -289,7 +288,7 @@ void WIMP_Poll(_THIS, int waitTime) /* Fall out of polling loop if message is successfully posted */ if (SDL_PrivateSysWMEvent(&wmmsg)) doPoll = 0; } -#ifndef DISABLE_THREADS +#if !SDL_THREADS_DISABLED if (riscos_using_threads) { /* Restart ticker here so other thread can not interfere @@ -324,7 +323,7 @@ void RISCOS_BackgroundTasks(void) { WIMP_Poll(current_video, 0); } -#ifdef DISABLE_THREADS +#if SDL_THREADS_DISABLED if (SDL_timer_running) RISCOS_CheckTimer(); #endif } diff --git a/src/video/riscos/SDL_wimpvideo.c b/src/video/riscos/SDL_wimpvideo.c index ed72a0e0..7d62ca73 100644 --- a/src/video/riscos/SDL_wimpvideo.c +++ b/src/video/riscos/SDL_wimpvideo.c @@ -29,9 +29,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_riscostask.h" #include "SDL_riscosvideo.h" diff --git a/src/video/svga/Makefile.am b/src/video/svga/Makefile.am deleted file mode 100644 index 2758bd1a..00000000 --- a/src/video/svga/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for SDL using the SVGAlib video driver - -noinst_LTLIBRARIES = libvideo_svga.la -libvideo_svga_la_SOURCES = $(SVGA_SRCS) - -# The SDL SVGAlib video driver sources -SVGA_SRCS = \ - SDL_svgavideo.h \ - SDL_svgaevents.c \ - SDL_svgaevents_c.h \ - SDL_svgamouse.c \ - SDL_svgamouse_c.h \ - SDL_svgavideo.c - diff --git a/src/video/svga/SDL_svgaevents.c b/src/video/svga/SDL_svgaevents.c index 8f6d7386..4ed97b16 100644 --- a/src/video/svga/SDL_svgaevents.c +++ b/src/video/svga/SDL_svgaevents.c @@ -34,8 +34,8 @@ #error You must choose your operating system here #endif -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_svgavideo.h" #include "SDL_svgaevents_c.h" diff --git a/src/video/svga/SDL_svgamouse.c b/src/video/svga/SDL_svgamouse.c index 0a9e05e6..49fa102a 100644 --- a/src/video/svga/SDL_svgamouse.c +++ b/src/video/svga/SDL_svgamouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_svgavideo.h" #include "SDL_svgamouse_c.h" diff --git a/src/video/svga/SDL_svgavideo.c b/src/video/svga/SDL_svgavideo.c index c474c6e1..f90f20e3 100644 --- a/src/video/svga/SDL_svgavideo.c +++ b/src/video/svga/SDL_svgavideo.c @@ -42,9 +42,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_svgavideo.h" #include "SDL_svgaevents_c.h" #include "SDL_svgamouse_c.h" diff --git a/src/video/svga/SDL_svgavideo.h b/src/video/svga/SDL_svgavideo.h index 0ba14708..d9afc89b 100644 --- a/src/video/svga/SDL_svgavideo.h +++ b/src/video/svga/SDL_svgavideo.h @@ -24,7 +24,7 @@ #define _SDL_svgavideo_h #include "SDL_mouse.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/vgl/Makefile.am b/src/video/vgl/Makefile.am deleted file mode 100644 index ea32027c..00000000 --- a/src/video/vgl/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for SDL using the libVGL video driver - -noinst_LTLIBRARIES = libvideo_vgl.la -libvideo_vgl_la_SOURCES = $(VGL_SRCS) - -# The SDL libVGL video driver sources -VGL_SRCS = \ - SDL_vglvideo.h \ - SDL_vglevents.c \ - SDL_vglevents_c.h \ - SDL_vglmouse.c \ - SDL_vglmouse_c.h \ - SDL_vglvideo.c - diff --git a/src/video/vgl/SDL_vglevents.c b/src/video/vgl/SDL_vglevents.c index 6dba3f46..33f19111 100644 --- a/src/video/vgl/SDL_vglevents.c +++ b/src/video/vgl/SDL_vglevents.c @@ -31,8 +31,8 @@ #include "SDL.h" #include "SDL_thread.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_vglvideo.h" #include "SDL_vglevents_c.h" diff --git a/src/video/vgl/SDL_vglmouse.c b/src/video/vgl/SDL_vglmouse.c index 04796f64..d9d49340 100644 --- a/src/video/vgl/SDL_vglmouse.c +++ b/src/video/vgl/SDL_vglmouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_vglvideo.h" #include "SDL_vglmouse_c.h" diff --git a/src/video/vgl/SDL_vglvideo.c b/src/video/vgl/SDL_vglvideo.c index df8a3f98..dfe6cc6c 100644 --- a/src/video/vgl/SDL_vglvideo.c +++ b/src/video/vgl/SDL_vglvideo.c @@ -35,9 +35,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_vglvideo.h" #include "SDL_vglevents_c.h" #include "SDL_vglmouse_c.h" diff --git a/src/video/vgl/SDL_vglvideo.h b/src/video/vgl/SDL_vglvideo.h index 04c61231..e909fa16 100644 --- a/src/video/vgl/SDL_vglvideo.h +++ b/src/video/vgl/SDL_vglvideo.h @@ -29,7 +29,7 @@ #include "SDL_mouse.h" #include "SDL_mutex.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/wincommon/Makefile.am b/src/video/wincommon/Makefile.am deleted file mode 100644 index e1ab8741..00000000 --- a/src/video/wincommon/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -## Makefile.am for common files used by the SDL Win32 video drivers - -noinst_LTLIBRARIES = libvideo_wincommon.la -libvideo_wincommon_la_SOURCES = $(WINCOMMON_SRCS) - -# The SDL Win32 video driver common sources -WINCOMMON_SRCS = \ - SDL_lowvideo.h \ - SDL_sysevents.c \ - SDL_sysmouse.c \ - SDL_sysmouse_c.h \ - SDL_syswm.c \ - SDL_syswm_c.h \ - SDL_wingl.c \ - SDL_wingl_c.h \ - wmmsg.h diff --git a/src/video/wincommon/SDL_lowvideo.h b/src/video/wincommon/SDL_lowvideo.h index 6776515a..e6040983 100644 --- a/src/video/wincommon/SDL_lowvideo.h +++ b/src/video/wincommon/SDL_lowvideo.h @@ -25,7 +25,7 @@ #include "SDL_windows.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 3a0ff11c..5a67c90b 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -25,9 +25,9 @@ #include "SDL_events.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_lowvideo.h" #include "SDL_syswm_c.h" #include "SDL_main.h" @@ -724,7 +724,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst) class.hbrBackground = NULL; class.hInstance = SDL_Instance; class.style = SDL_Appstyle; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL class.style |= CS_OWNDC; #endif class.lpfnWndProc = WinMessage; diff --git a/src/video/wincommon/SDL_sysmouse.c b/src/video/wincommon/SDL_sysmouse.c index d5a7e454..d6747282 100644 --- a/src/video/wincommon/SDL_sysmouse.c +++ b/src/video/wincommon/SDL_sysmouse.c @@ -23,9 +23,9 @@ #include "SDL_windows.h" #include "SDL_mouse.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_sysmouse_c.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" #include "SDL_lowvideo.h" #ifdef _WIN32_WCE diff --git a/src/video/wincommon/SDL_syswm.c b/src/video/wincommon/SDL_syswm.c index 7ef43456..95bd948f 100644 --- a/src/video/wincommon/SDL_syswm.c +++ b/src/video/wincommon/SDL_syswm.c @@ -24,21 +24,18 @@ #include "SDL_version.h" #include "SDL_video.h" +#include "SDL_loadso.h" #include "SDL_syswm.h" +#include "../SDL_pixels_c.h" +#include "../SDL_cursor_c.h" #include "SDL_syswm_c.h" #include "SDL_wingl_c.h" -#include "SDL_pixels_c.h" -#include "SDL_loadso.h" #ifdef _WIN32_WCE #define DISABLE_ICON_SUPPORT #endif -/* RJR: March 28, 2000 - we need "SDL_cursor_c.h" for mods to WIN_GrabInput */ -#include "SDL_cursor_c.h" - /* The screen icon -- needs to be freed on SDL_VideoQuit() */ HICON screen_icn = NULL; @@ -307,7 +304,7 @@ int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info) info->version.minor, info->version.patch) >= SDL_VERSIONNUM(1, 2, 5) ) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL info->hglrc = GL_hrc; #else info->hglrc = NULL; diff --git a/src/video/wincommon/SDL_wingl.c b/src/video/wincommon/SDL_wingl.c index c9753e37..ba04e285 100644 --- a/src/video/wincommon/SDL_wingl.c +++ b/src/video/wincommon/SDL_wingl.c @@ -22,13 +22,13 @@ /* WGL implementation of SDL OpenGL support */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #include "SDL_opengl.h" #endif #include "SDL_lowvideo.h" #include "SDL_wingl_c.h" -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #define DEFAULT_GL_DRIVER_PATH "OPENGL32.DLL" #endif @@ -69,7 +69,7 @@ static int WIN_GL_ResetWindow(_THIS) return(status); } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static int ExtensionSupported(const char *extension, const char *extensions) { @@ -159,12 +159,12 @@ static void Init_WGL_ARB_extensions(_THIS) DestroyWindow(hwnd); } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ int WIN_GL_SetupWindow(_THIS) { int retval; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL int i; unsigned int matching; int iAttribs[64]; @@ -330,7 +330,7 @@ int WIN_GL_SetupWindow(_THIS) void WIN_GL_ShutDown(_THIS) { -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Clean up OpenGL */ if ( GL_hrc ) { this->gl_data->wglMakeCurrent(NULL, NULL); @@ -344,10 +344,10 @@ void WIN_GL_ShutDown(_THIS) gl_active = 0; WIN_GL_UnloadLibrary(this); -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* Make the current context active */ int WIN_GL_MakeCurrent(_THIS) @@ -569,4 +569,4 @@ void *WIN_GL_GetProcAddress(_THIS, const char* proc) return func; } -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ diff --git a/src/video/wincommon/SDL_wingl_c.h b/src/video/wincommon/SDL_wingl_c.h index 4ddc5704..8b0ebb02 100644 --- a/src/video/wincommon/SDL_wingl_c.h +++ b/src/video/wincommon/SDL_wingl_c.h @@ -22,13 +22,13 @@ /* WGL implementation of SDL OpenGL support */ -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" struct SDL_PrivateGLData { int gl_active; /* to stop switching drivers while we have a valid context */ -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL PIXELFORMATDESCRIPTOR GL_pfd; HDC GL_hdc; HGLRC GL_hrc; @@ -52,7 +52,7 @@ struct SDL_PrivateGLData { UINT nAttributes, const int *piAttributes, int *piValues); -#endif /* HAVE_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ }; /* Old variable names */ @@ -65,7 +65,7 @@ struct SDL_PrivateGLData { /* OpenGL functions */ extern int WIN_GL_SetupWindow(_THIS); extern void WIN_GL_ShutDown(_THIS); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL extern int WIN_GL_MakeCurrent(_THIS); extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void WIN_GL_SwapBuffers(_THIS); @@ -74,7 +74,7 @@ extern int WIN_GL_LoadLibrary(_THIS, const char* path); extern void *WIN_GL_GetProcAddress(_THIS, const char* proc); #endif -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL #ifndef WGL_ARB_pixel_format #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 diff --git a/src/video/windib/Makefile.am b/src/video/windib/Makefile.am deleted file mode 100644 index f9c1d193..00000000 --- a/src/video/windib/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -## Makefile.am for SDL using the Win32 DIB video driver - -noinst_LTLIBRARIES = libvideo_windib.la -libvideo_windib_la_SOURCES = $(WINDIB_SRCS) - -# The SDL Win32 DIB video driver sources -WINDIB_SRCS = \ - SDL_dibevents.c \ - SDL_dibevents_c.h \ - SDL_dibvideo.c \ - SDL_dibvideo.h \ - SDL_vkeys.h diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index bcb61f92..1b73b214 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -25,9 +25,9 @@ #include "SDL_main.h" #include "SDL_events.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" -#include "SDL_lowvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" +#include "../wincommon/SDL_lowvideo.h" #include "SDL_dibvideo.h" #include "SDL_vkeys.h" diff --git a/src/video/windib/SDL_dibevents_c.h b/src/video/windib/SDL_dibevents_c.h index a107ed79..4de1d857 100644 --- a/src/video/windib/SDL_dibevents_c.h +++ b/src/video/windib/SDL_dibevents_c.h @@ -20,7 +20,7 @@ slouken@libsdl.org */ -#include "SDL_lowvideo.h" +#include "../wincommon/SDL_lowvideo.h" /* Variables and functions exported by SDL_dibevents.c to other parts of the native video subsystem (SDL_dibvideo.c) diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index ff512908..c9f70683 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -35,15 +35,15 @@ extern HINSTANCE aygshell; #endif #include "SDL_syswm.h" -#include "SDL_sysvideo.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" -#include "SDL_pixels_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_dibvideo.h" -#include "SDL_syswm_c.h" -#include "SDL_sysmouse_c.h" +#include "../wincommon/SDL_syswm_c.h" +#include "../wincommon/SDL_sysmouse_c.h" #include "SDL_dibevents_c.h" -#include "SDL_wingl_c.h" +#include "../wincommon/SDL_wingl_c.h" #ifdef _WIN32_WCE #define NO_GETDIBITS @@ -151,7 +151,7 @@ static SDL_VideoDevice *DIB_CreateDevice(int devindex) device->FreeHWSurface = DIB_FreeHWSurface; device->SetGammaRamp = DIB_SetGammaRamp; device->GetGammaRamp = DIB_GetGammaRamp; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_LoadLibrary = WIN_GL_LoadLibrary; device->GL_GetProcAddress = WIN_GL_GetProcAddress; device->GL_GetAttribute = WIN_GL_GetAttribute; @@ -291,7 +291,7 @@ int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat) if ( DIB_CreateWindow(this) < 0 ) { return(-1); } -#ifndef DISABLE_AUDIO +#if !SDL_AUDIO_DISABLED DX5_SoundFocus(SDL_Window); #endif @@ -1022,7 +1022,7 @@ static void DIB_WinPAINT(_THIS, HDC hdc) } /* Stub in case DirectX isn't available */ -#ifndef ENABLE_DIRECTX +#if !SDL_AUDIO_DRIVER_DSOUND void DX5_SoundFocus(HWND hwnd) { return; diff --git a/src/video/windx5/Makefile.am b/src/video/windx5/Makefile.am deleted file mode 100644 index 27a8f97f..00000000 --- a/src/video/windx5/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - -## Makefile.am for SDL using the DirectX video driver - -noinst_LTLIBRARIES = libvideo_windx5.la -libvideo_windx5_la_SOURCES = $(DIRECTX_SRCS) - -# The SDL DirectX video driver sources -DIRECTX_SRCS = \ - SDL_dx5events.c \ - SDL_dx5events_c.h \ - SDL_dx5video.c \ - SDL_dx5video.h \ - SDL_dx5yuv.c \ - SDL_dx5yuv_c.h \ - directx.h diff --git a/src/video/windx5/SDL_dx5events.c b/src/video/windx5/SDL_dx5events.c index dcd06521..25c518cd 100644 --- a/src/video/windx5/SDL_dx5events.c +++ b/src/video/windx5/SDL_dx5events.c @@ -28,9 +28,9 @@ #include "SDL_events.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" -#include "SDL_lowvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" +#include "../wincommon/SDL_lowvideo.h" #include "SDL_dx5video.h" #ifndef WM_APP diff --git a/src/video/windx5/SDL_dx5events_c.h b/src/video/windx5/SDL_dx5events_c.h index 100ed344..bb3efcd9 100644 --- a/src/video/windx5/SDL_dx5events_c.h +++ b/src/video/windx5/SDL_dx5events_c.h @@ -20,7 +20,7 @@ slouken@libsdl.org */ -#include "SDL_lowvideo.h" +#include "../wincommon/SDL_lowvideo.h" /* Variables and functions exported by SDL_dx5events.c to other parts of the native video subsystem (SDL_dx5video.c) diff --git a/src/video/windx5/SDL_dx5video.c b/src/video/windx5/SDL_dx5video.c index 3de46639..12946135 100644 --- a/src/video/windx5/SDL_dx5video.c +++ b/src/video/windx5/SDL_dx5video.c @@ -30,15 +30,15 @@ #include "SDL_timer.h" #include "SDL_events.h" #include "SDL_syswm.h" -#include "SDL_sysvideo.h" -#include "SDL_blit.h" -#include "SDL_pixels_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_blit.h" +#include "../SDL_pixels_c.h" #include "SDL_dx5video.h" -#include "SDL_syswm_c.h" -#include "SDL_sysmouse_c.h" +#include "../wincommon/SDL_syswm_c.h" +#include "../wincommon/SDL_sysmouse_c.h" #include "SDL_dx5events_c.h" #include "SDL_dx5yuv_c.h" -#include "SDL_wingl_c.h" +#include "../wincommon/SDL_wingl_c.h" #ifdef _WIN32_WCE #define NO_CHANGEDISPLAYSETTINGS @@ -598,7 +598,7 @@ static SDL_VideoDevice *DX5_CreateDevice(int devindex) device->FreeHWSurface = DX5_FreeHWSurface; device->SetGammaRamp = DX5_SetGammaRamp; device->GetGammaRamp = DX5_GetGammaRamp; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL device->GL_LoadLibrary = WIN_GL_LoadLibrary; device->GL_GetProcAddress = WIN_GL_GetProcAddress; device->GL_GetAttribute = WIN_GL_GetAttribute; @@ -901,7 +901,7 @@ int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat) if ( DX5_CreateWindow(this) < 0 ) { return(-1); } -#ifndef DISABLE_AUDIO +#if !SDL_AUDIO_DISABLED DX5_SoundFocus(SDL_Window); #endif diff --git a/src/video/windx5/SDL_dx5yuv.c b/src/video/windx5/SDL_dx5yuv.c index ea395a68..6789926d 100644 --- a/src/video/windx5/SDL_dx5yuv.c +++ b/src/video/windx5/SDL_dx5yuv.c @@ -24,7 +24,7 @@ #include "SDL_video.h" #include "SDL_dx5yuv_c.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" //#define USE_DIRECTX_OVERLAY diff --git a/src/video/windx5/SDL_dx5yuv_c.h b/src/video/windx5/SDL_dx5yuv_c.h index 9dddaeb7..27fe455d 100644 --- a/src/video/windx5/SDL_dx5yuv_c.h +++ b/src/video/windx5/SDL_dx5yuv_c.h @@ -23,7 +23,7 @@ /* This is the DirectDraw implementation of YUV video overlays */ #include "SDL_video.h" -#include "SDL_lowvideo.h" +#include "../wincommon/SDL_lowvideo.h" #include "SDL_dx5video.h" extern SDL_Overlay *DX5_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); diff --git a/src/video/wscons/Makefile.am b/src/video/wscons/Makefile.am deleted file mode 100644 index 76ae6727..00000000 --- a/src/video/wscons/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -## Makefile.am for SDL using the wscons video driver - -noinst_LTLIBRARIES = libvideo_wscons.la -libvideo_wscons_la_SOURCES = $(WSCONS_SRCS) - -# The SDL wscons video driver sources -WSCONS_SRCS = \ - SDL_wsconsvideo.h \ - SDL_wsconsevents.c \ - SDL_wsconsevents_c.h \ - SDL_wsconsmouse.c \ - SDL_wsconsmouse_c.h \ - SDL_wsconsvideo.c - diff --git a/src/video/wscons/SDL_wsconsevents.c b/src/video/wscons/SDL_wsconsevents.c index 11b5cb6a..4fc4ed83 100644 --- a/src/video/wscons/SDL_wsconsevents.c +++ b/src/video/wscons/SDL_wsconsevents.c @@ -30,8 +30,8 @@ #include <string.h> #include "SDL.h" -#include "SDL_sysevents.h" -#include "SDL_events_c.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_wsconsvideo.h" #include "SDL_wsconsevents_c.h" diff --git a/src/video/wscons/SDL_wsconsmouse.c b/src/video/wscons/SDL_wsconsmouse.c index 8cc14501..6116f6fd 100644 --- a/src/video/wscons/SDL_wsconsmouse.c +++ b/src/video/wscons/SDL_wsconsmouse.c @@ -21,7 +21,7 @@ */ #include "SDL_mouse.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_wsconsmouse_c.h" diff --git a/src/video/wscons/SDL_wsconsvideo.c b/src/video/wscons/SDL_wsconsvideo.c index ca851731..fc0238e5 100644 --- a/src/video/wscons/SDL_wsconsvideo.c +++ b/src/video/wscons/SDL_wsconsvideo.c @@ -30,9 +30,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_wsconsvideo.h" #include "SDL_wsconsevents_c.h" diff --git a/src/video/wscons/SDL_wsconsvideo.h b/src/video/wscons/SDL_wsconsvideo.h index 12c584e7..538cbaed 100644 --- a/src/video/wscons/SDL_wsconsvideo.h +++ b/src/video/wscons/SDL_wsconsvideo.h @@ -26,9 +26,10 @@ #include <sys/time.h> #include <termios.h> #include <dev/wscons/wsconsio.h> + #include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_mutex.h" +#include "../SDL_sysvideo.h" void WSCONS_ReportError(char *fmt, ...); diff --git a/src/video/x11/Makefile.am b/src/video/x11/Makefile.am deleted file mode 100644 index e81122e6..00000000 --- a/src/video/x11/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ - -## Makefile.am for SDL using the X11 video driver - -noinst_LTLIBRARIES = libvideo_x11.la -libvideo_x11_la_SOURCES = $(X11_SRCS) - -x11_lib = \"@x11_lib@\" -x11ext_lib = \"@x11ext_lib@\" - -# The SDL X11 video driver sources -X11_SRCS = \ - SDL_x11dga.c \ - SDL_x11dga_c.h \ - SDL_x11events.c \ - SDL_x11events_c.h \ - SDL_x11gamma.c \ - SDL_x11gamma_c.h \ - SDL_x11gl.c \ - SDL_x11gl_c.h \ - SDL_x11image.c \ - SDL_x11image_c.h \ - SDL_x11modes.c \ - SDL_x11modes_c.h \ - SDL_x11mouse.c \ - SDL_x11mouse_c.h \ - SDL_x11video.c \ - SDL_x11video.h \ - SDL_x11wm.c \ - SDL_x11wm_c.h \ - SDL_x11yuv.c \ - SDL_x11yuv_c.h \ - SDL_x11dyn.c \ - SDL_x11dyn.h \ - SDL_x11sym.h - diff --git a/src/video/x11/SDL_x11dga.c b/src/video/x11/SDL_x11dga.c index 1998f934..cd9cfa30 100644 --- a/src/video/x11/SDL_x11dga.c +++ b/src/video/x11/SDL_x11dga.c @@ -26,7 +26,7 @@ */ #include "SDL_video.h" -#include "SDL_cursor_c.h" +#include "../SDL_cursor_c.h" #include "SDL_x11dga_c.h" /* Global for the error handler */ @@ -34,17 +34,13 @@ int dga_event, dga_error = -1; void X11_EnableDGAMouse(_THIS) { -#ifdef XFREE86_DGAMOUSE +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE int dga_major, dga_minor; int use_dgamouse; const char *env_use_dgamouse; /* Check configuration to see if we should use DGA mouse */ -#ifdef DEFAULT_DGAMOUSE use_dgamouse = 1; -#else - use_dgamouse = 0; -#endif env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); if ( env_use_dgamouse ) { use_dgamouse = atoi(env_use_dgamouse); @@ -61,13 +57,13 @@ void X11_EnableDGAMouse(_THIS) using_dga |= DGA_MOUSE; } } -#endif /* XFREE86_DGAMOUSE */ +#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */ } /* Argh. Glide resets DGA mouse mode when it makes the context current! */ void X11_CheckDGAMouse(_THIS) { -#ifdef XFREE86_DGAMOUSE +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE int flags; if ( using_dga & DGA_MOUSE ) { @@ -81,10 +77,10 @@ void X11_CheckDGAMouse(_THIS) void X11_DisableDGAMouse(_THIS) { -#ifdef XFREE86_DGAMOUSE +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE if ( using_dga & DGA_MOUSE ) { SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0); using_dga &= ~DGA_MOUSE; } -#endif /* XFREE86_DGAMOUSE */ +#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */ } diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index 270e789e..120613cd 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -24,6 +24,8 @@ #define DEBUG_DYNAMIC_X11 1 #endif +#include "SDL_config.h" + #define __SDL_NO_REDEFINE_X11_HEADER_SYMS 1 #include "SDL_x11dyn.h" @@ -31,13 +33,13 @@ #include <stdio.h> #endif -#ifdef X11_DYNAMIC +#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC #include <dlfcn.h> #include "SDL_name.h" #include "SDL_loadso.h" -static const char *x11_library = X11_DYNAMIC; +static const char *x11_library = SDL_VIDEO_DRIVER_X11_DYNAMIC; static void *x11_handle = NULL; -static const char *x11ext_library = X11EXT_DYNAMIC; +static const char *x11ext_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT; static void *x11ext_handle = NULL; static void *X11_GetSym(int required, const char *fnname, int *rc) @@ -65,7 +67,7 @@ static void *X11_GetSym(int required, const char *fnname, int *rc) return fn; } -#endif /* defined X11_DYNAMIC */ +#endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */ /* Define all the function pointers... */ #define SDL_X11_SYM(req,ret,fn,params) ret (*p##fn) params = NULL; @@ -84,7 +86,7 @@ void SDL_X11_UnloadSymbols(void) #include "SDL_x11sym.h" #undef SDL_X11_SYM - #ifdef X11_DYNAMIC + #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC if (x11_handle != NULL) { SDL_UnloadObject(x11_handle); x11_handle = NULL; @@ -105,7 +107,7 @@ int SDL_X11_LoadSymbols(void) /* deal with multiple modules (dga, x11, etc) needing these symbols... */ if (x11_load_refcount++ == 0) { - #ifdef X11_DYNAMIC + #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC x11_handle = SDL_LoadObject(x11_library); x11ext_handle = SDL_LoadObject(x11ext_library); rc = ((x11_handle != NULL) && (x11ext_handle != NULL)); diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index 95c575a8..d3db793a 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -29,7 +29,7 @@ #include <X11/Xlibint.h> #include <X11/Xproto.h> -#include <Xext/extensions/extutil.h> +#include "../Xext/extensions/extutil.h" #ifndef NO_SHARED_MEMORY #include <sys/ipc.h> @@ -71,7 +71,7 @@ typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *); #define XFree pXFree #define _XData32 p_XData32 -#if defined(__osf__) && defined(X11_DYNAMIC) +#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC) #define _SmtBufferOverflow p_SmtBufferOverflow #define _SmtIpError p_SmtIpError #define ipAllocateData pipAllocateData diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 9c2ac52a..efbd576a 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -35,9 +35,9 @@ #include "SDL_timer.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" -#include "SDL_sysvideo.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_sysevents.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11video.h" #include "SDL_x11dga_c.h" #include "SDL_x11modes_c.h" diff --git a/src/video/x11/SDL_x11gamma.c b/src/video/x11/SDL_x11gamma.c index 834acfa2..b60d66eb 100644 --- a/src/video/x11/SDL_x11gamma.c +++ b/src/video/x11/SDL_x11gamma.c @@ -22,7 +22,7 @@ #include "SDL.h" #include "SDL_events.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11video.h" /* From the X server sources... */ @@ -31,7 +31,7 @@ static int X11_SetGammaNoLock(_THIS, float red, float green, float blue) { -#ifdef XFREE86_VMGAMMA +#if SDL_VIDEO_DRIVER_X11_VIDMODE if (use_vidmode >= 200) { SDL_NAME(XF86VidModeGamma) gamma; Bool succeeded; @@ -92,7 +92,7 @@ int X11_SetVidModeGamma(_THIS, float red, float green, float blue) static int X11_GetGammaNoLock(_THIS, float *red, float *green, float *blue) { -#ifdef XFREE86_VMGAMMA +#if SDL_VIDEO_DRIVER_X11_VIDMODE if (use_vidmode >= 200) { SDL_NAME(XF86VidModeGamma) gamma; if (SDL_NAME(XF86VidModeGetGamma)(SDL_Display, SDL_Screen, &gamma)) { diff --git a/src/video/x11/SDL_x11gl.c b/src/video/x11/SDL_x11gl.c index 45cd2de1..724c46a6 100644 --- a/src/video/x11/SDL_x11gl.c +++ b/src/video/x11/SDL_x11gl.c @@ -21,7 +21,7 @@ */ #include "SDL_x11video.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11dga_c.h" #include "SDL_x11gl_c.h" @@ -42,7 +42,7 @@ XVisualInfo *X11_GL_GetVisual(_THIS) { -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX /* 64 seems nice. */ int attribs[64]; int i; @@ -170,7 +170,7 @@ XVisualInfo *X11_GL_GetVisual(_THIS) int X11_GL_CreateWindow(_THIS, int w, int h) { int retval; -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX XSetWindowAttributes attributes; unsigned long mask; unsigned long black; @@ -202,7 +202,7 @@ int X11_GL_CreateWindow(_THIS, int w, int h) int X11_GL_CreateContext(_THIS) { int retval; -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX /* We do this to create a clean separation between X and GLX errors. */ pXSync( SDL_Display, False ); glx_context = this->gl_data->glXCreateContext(GFX_Display, @@ -228,7 +228,7 @@ int X11_GL_CreateContext(_THIS) void X11_GL_Shutdown(_THIS) { -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX /* Clean up OpenGL */ if( glx_context ) { this->gl_data->glXMakeCurrent(GFX_Display, None, NULL); @@ -239,10 +239,10 @@ void X11_GL_Shutdown(_THIS) glx_context = NULL; } gl_active = 0; -#endif /* HAVE_OPENGL_X11 */ +#endif /* SDL_VIDEO_OPENGL_GLX */ } -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX /* Make the current context active */ int X11_GL_MakeCurrent(_THIS) @@ -331,19 +331,14 @@ void X11_GL_SwapBuffers(_THIS) this->gl_data->glXSwapBuffers(GFX_Display, SDL_Window); } -#endif /* HAVE_OPENGL_X11 */ +#endif /* SDL_VIDEO_OPENGL_GLX */ void X11_GL_UnloadLibrary(_THIS) { -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX if ( this->gl_config.driver_loaded ) { - /* !!! FIXME: Can we just use SDL_UnloadObject() everywhere? */ - #ifdef USE_DLOPEN - dlclose(this->gl_config.dll_handle); - #else SDL_UnloadObject(this->gl_config.dll_handle); - #endif this->gl_data->glXGetProcAddress = NULL; this->gl_data->glXChooseVisual = NULL; @@ -358,21 +353,7 @@ void X11_GL_UnloadLibrary(_THIS) #endif } -#ifdef HAVE_OPENGL_X11 - -static void *do_dlsym(void *handle, const char *name) -{ - /* !!! FIXME: Can we just use SDL_LoadFunction() everywhere? */ -#ifdef USE_DLOPEN - return dlsym(handle, name); -#else - return SDL_LoadFunction(handle, name); -#endif -} - -#if defined(__OpenBSD__) && !defined(__ELF__) -#define do_dlsym(x,y) do_dlsym(x, "_" y) -#endif +#if SDL_VIDEO_OPENGL_GLX /* Passing a NULL path means load pointers from the application */ int X11_GL_LoadLibrary(_THIS, const char* path) @@ -391,49 +372,32 @@ int X11_GL_LoadLibrary(_THIS, const char* path) } } - /* !!! FIXME: Can we just use SDL_LoadObject() everywhere? */ - #ifdef USE_DLOPEN - { - #ifdef RTLD_GLOBAL - int dlopen_flags = RTLD_LAZY | RTLD_GLOBAL; - #else - int dlopen_flags = RTLD_LAZY; - #endif - handle = dlopen(path, dlopen_flags); - if ( handle == NULL ) { - SDL_SetError("Could not load OpenGL library: %s", (const char *) dlerror()); - return -1; - } + handle = SDL_LoadObject(path); + if ( handle == NULL ) { + /* SDL_LoadObject() will call SDL_SetError() for us. */ + return -1; } - #else - handle = SDL_LoadObject(path); - if ( handle == NULL ) { - /* SDL_LoadObject() will call SDL_SetError() for us. */ - return -1; - } - #endif - /* Unload the old driver and reset the pointers */ X11_GL_UnloadLibrary(this); /* Load new function pointers */ this->gl_data->glXGetProcAddress = - (void *(*)(const GLubyte *)) do_dlsym(handle, "glXGetProcAddressARB"); + (void *(*)(const GLubyte *)) SDL_LoadFunction(handle, "glXGetProcAddressARB"); this->gl_data->glXChooseVisual = - (XVisualInfo *(*)(Display *, int, int *)) do_dlsym(handle, "glXChooseVisual"); + (XVisualInfo *(*)(Display *, int, int *)) SDL_LoadFunction(handle, "glXChooseVisual"); this->gl_data->glXCreateContext = - (GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) do_dlsym(handle, "glXCreateContext"); + (GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) SDL_LoadFunction(handle, "glXCreateContext"); this->gl_data->glXDestroyContext = - (void (*)(Display *, GLXContext)) do_dlsym(handle, "glXDestroyContext"); + (void (*)(Display *, GLXContext)) SDL_LoadFunction(handle, "glXDestroyContext"); this->gl_data->glXMakeCurrent = - (int (*)(Display *, GLXDrawable, GLXContext)) do_dlsym(handle, "glXMakeCurrent"); + (int (*)(Display *, GLXDrawable, GLXContext)) SDL_LoadFunction(handle, "glXMakeCurrent"); this->gl_data->glXSwapBuffers = - (void (*)(Display *, GLXDrawable)) do_dlsym(handle, "glXSwapBuffers"); + (void (*)(Display *, GLXDrawable)) SDL_LoadFunction(handle, "glXSwapBuffers"); this->gl_data->glXGetConfig = - (int (*)(Display *, XVisualInfo *, int, int *)) do_dlsym(handle, "glXGetConfig"); + (int (*)(Display *, XVisualInfo *, int, int *)) SDL_LoadFunction(handle, "glXGetConfig"); this->gl_data->glXQueryExtensionsString = - (const char *(*)(Display *, int)) do_dlsym(handle, "glXQueryExtensionsString"); + (const char *(*)(Display *, int)) SDL_LoadFunction(handle, "glXQueryExtensionsString"); if ( (this->gl_data->glXChooseVisual == NULL) || @@ -460,24 +424,13 @@ int X11_GL_LoadLibrary(_THIS, const char* path) void *X11_GL_GetProcAddress(_THIS, const char* proc) { - static char procname[1024]; void* handle; - void* retval; handle = this->gl_config.dll_handle; if ( this->gl_data->glXGetProcAddress ) { return this->gl_data->glXGetProcAddress((const GLubyte *)proc); } -#if defined(__OpenBSD__) && !defined(__ELF__) -#undef do_dlsym -#endif - retval = do_dlsym(handle, proc); - if (!retval && SDL_strlen(proc) <= 1022) { - procname[0] = '_'; - SDL_strcpy(procname + 1, proc); - retval = do_dlsym(handle, procname); - } - return retval; + return SDL_LoadFunction(handle, proc); } -#endif /* HAVE_OPENGL_X11 */ +#endif /* SDL_VIDEO_OPENGL_GLX */ diff --git a/src/video/x11/SDL_x11gl_c.h b/src/video/x11/SDL_x11gl_c.h index 717e0fc2..15d89384 100644 --- a/src/video/x11/SDL_x11gl_c.h +++ b/src/video/x11/SDL_x11gl_c.h @@ -20,21 +20,17 @@ slouken@libsdl.org */ -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX #include <GL/glx.h> -#ifdef USE_DLOPEN -#include <dlfcn.h> -#else #include "SDL_loadso.h" #endif -#endif -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" struct SDL_PrivateGLData { int gl_active; /* to stop switching drivers while we have a valid context */ -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX GLXContext glx_context; /* Current GL context */ XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */ @@ -75,7 +71,7 @@ struct SDL_PrivateGLData { int screen ); -#endif /* HAVE_OPENGL_X11 */ +#endif /* SDL_VIDEO_OPENGL_GLX */ }; /* Old variable names */ @@ -88,7 +84,7 @@ extern XVisualInfo *X11_GL_GetVisual(_THIS); extern int X11_GL_CreateWindow(_THIS, int w, int h); extern int X11_GL_CreateContext(_THIS); extern void X11_GL_Shutdown(_THIS); -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX extern int X11_GL_MakeCurrent(_THIS); extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void X11_GL_SwapBuffers(_THIS); diff --git a/src/video/x11/SDL_x11image.c b/src/video/x11/SDL_x11image.c index 3392a06a..4e7e4756 100644 --- a/src/video/x11/SDL_x11image.c +++ b/src/video/x11/SDL_x11image.c @@ -24,7 +24,7 @@ #include <unistd.h> #include "SDL_endian.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11image_c.h" #ifndef NO_SHARED_MEMORY diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index eeb0a46c..266ac2db 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -26,27 +26,27 @@ #include "SDL_timer.h" #include "SDL_events.h" -#include "SDL_events_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11video.h" #include "SDL_x11wm_c.h" #include "SDL_x11modes_c.h" #include "SDL_x11image_c.h" -#ifdef HAVE_XINERAMA -#include <Xext/extensions/Xinerama.h> +#if SDL_VIDEO_DRIVER_X11_XINERAMA +#include "../Xext/extensions/Xinerama.h" #endif #define MAX(a, b) (a > b ? a : b) -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info) { SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock); return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l); } -#endif /* XFREE86_VM */ +#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE static void save_mode(_THIS) { SDL_memset(&saved_mode, 0, sizeof(saved_mode)); @@ -55,7 +55,7 @@ static void save_mode(_THIS) } #endif -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE static void restore_mode(_THIS) { SDL_NAME(XF86VidModeModeLine) mode; @@ -73,7 +73,7 @@ static void restore_mode(_THIS) } #endif -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE static int cmpmodes(const void *va, const void *vb) { const SDL_NAME(XF86VidModeModeInfo) *a = *(const SDL_NAME(XF86VidModeModeInfo)**)va; @@ -89,7 +89,7 @@ static void get_real_resolution(_THIS, int* w, int* h); static void set_best_resolution(_THIS, int width, int height) { -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE if ( use_vidmode ) { SDL_NAME(XF86VidModeModeLine) mode; SDL_NAME(XF86VidModeModeInfo) **modes; @@ -137,10 +137,10 @@ static void set_best_resolution(_THIS, int width, int height) pXFree(modes); } } -#endif /* XFREE86_VM */ +#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ /* XiG */ -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME #ifdef XIG_DEBUG fprintf(stderr, "XME: set_best_resolution(): w = %d, h = %d\n", width, height); @@ -177,13 +177,13 @@ static void set_best_resolution(_THIS, int width, int height) } } } -#endif /* HAVE_XIGXME */ +#endif /* SDL_VIDEO_DRIVER_X11_XME */ } static void get_real_resolution(_THIS, int* w, int* h) { -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE if ( use_vidmode ) { SDL_NAME(XF86VidModeModeLine) mode; int unused; @@ -196,7 +196,7 @@ static void get_real_resolution(_THIS, int* w, int* h) } #endif -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME if ( use_xme ) { int ractive; XiGMiscResolutionInfo *modelist; @@ -277,13 +277,13 @@ int vm_event, vm_error = -1; int X11_GetVideoModes(_THIS) { -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE int buggy_X11; int vm_major, vm_minor; int nmodes; SDL_NAME(XF86VidModeModeInfo) **modes; #endif -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME int xme_major, xme_minor; int ractive, nummodes; XiGMiscResolutionInfo *modelist; @@ -297,7 +297,7 @@ int X11_GetVideoModes(_THIS) screen_w = DisplayWidth(SDL_Display, SDL_Screen); screen_h = DisplayHeight(SDL_Display, SDL_Screen); -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE /* Metro-X 4.3.0 and earlier has a broken implementation of XF86VidModeGetAllModeLines() - it hangs the client. */ @@ -407,10 +407,10 @@ int X11_GetVideoModes(_THIS) use_vidmode = vm_major * 100 + vm_minor; save_mode(this); } -#endif /* XFREE86_VM */ +#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ /* XiG */ -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME /* first lets make sure we have the extension, and it's at least v2.0 */ if (XiGMiscQueryVersion(SDL_Display, &xme_major, &xme_minor)) { #ifdef XIG_DEBUG @@ -478,7 +478,7 @@ int X11_GetVideoModes(_THIS) if ( modelist ) { pXFree(modelist); } -#endif /* HAVE_XIGXME */ +#endif /* SDL_VIDEO_DRIVER_X11_XME */ { static int depth_list[] = { 32, 24, 16, 15, 8 }; @@ -544,7 +544,7 @@ int X11_GetVideoModes(_THIS) printf("XFree86 VidMode is enabled\n"); } -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME if ( use_xme ) printf("Xi Graphics XME fullscreen is enabled\n"); else @@ -563,7 +563,7 @@ int X11_GetVideoModes(_THIS) xinerama_x = 0; xinerama_y = 0; -#ifdef HAVE_XINERAMA +#if SDL_VIDEO_DRIVER_X11_XINERAMA /* Query Xinerama extention */ if ( SDL_NAME(XineramaQueryExtension)(SDL_Display, &i, &i) && SDL_NAME(XineramaIsActive)(SDL_Display) ) { @@ -596,7 +596,7 @@ int X11_GetVideoModes(_THIS) } pXFree(xinerama); } -#endif /* HAVE_XINERAMA */ +#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */ return 0; } @@ -740,7 +740,7 @@ int X11_EnterFullScreen(_THIS) pXRaiseWindow(SDL_Display, FSwindow); #endif -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE /* Save the current video mode */ if ( use_vidmode ) { SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, True); @@ -777,14 +777,14 @@ int X11_LeaveFullScreen(_THIS) { if ( currently_fullscreen ) { pXReparentWindow(SDL_Display, SDL_Window, WMwindow, 0, 0); -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE if ( use_vidmode ) { restore_mode(this); SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, False); } #endif -#ifdef HAVE_XIGXME +#if SDL_VIDEO_DRIVER_X11_XME if ( use_xme ) { int rw, rh; diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 918bffcf..41887eb9 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -24,8 +24,8 @@ #include <X11/Xutil.h> #include "SDL_mouse.h" -#include "SDL_events_c.h" -#include "SDL_cursor_c.h" +#include "../../events/SDL_events_c.h" +#include "../SDL_cursor_c.h" #include "SDL_x11dga_c.h" #include "SDL_x11mouse_c.h" diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index d03c3039..b2c1f45b 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -39,9 +39,9 @@ #include "SDL_thread.h" #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11video.h" #include "SDL_x11wm_c.h" #include "SDL_x11mouse_c.h" @@ -51,7 +51,7 @@ #include "SDL_x11yuv_c.h" #include "SDL_x11gl_c.h" #include "SDL_x11gamma_c.h" -#include "blank_cursor.h" +#include "../blank_cursor.h" /* Initialization/Query functions */ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat); @@ -125,7 +125,7 @@ static SDL_VideoDevice *X11_CreateDevice(int devindex) device->SetVideoMode = X11_SetVideoMode; device->ToggleFullScreen = X11_ToggleFullScreen; device->UpdateMouse = X11_UpdateMouse; -#ifdef XFREE86_XV +#if SDL_VIDEO_DRIVER_X11_XV device->CreateYUVOverlay = X11_CreateYUVOverlay; #endif device->SetColors = X11_SetColors; @@ -144,7 +144,7 @@ static SDL_VideoDevice *X11_CreateDevice(int devindex) device->GetGamma = X11_GetVidModeGamma; device->SetGammaRamp = X11_SetGammaRamp; device->GetGammaRamp = NULL; -#ifdef HAVE_OPENGL_X11 +#if SDL_VIDEO_OPENGL_GLX device->GL_LoadLibrary = X11_GL_LoadLibrary; device->GL_GetProcAddress = X11_GL_GetProcAddress; device->GL_GetAttribute = X11_GL_GetAttribute; @@ -179,14 +179,14 @@ VideoBootStrap X11_bootstrap = { static int (*X_handler)(Display *, XErrorEvent *) = NULL; static int x_errhandler(Display *d, XErrorEvent *e) { -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE extern int vm_error; #endif -#ifdef XFREE86_DGAMOUSE +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE extern int dga_error; #endif -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE /* VidMode errors are non-fatal. :) */ /* Are the errors offset by one from the error base? e.g. the error base is 143, the code is 148, and the @@ -204,9 +204,9 @@ printf("VidMode error: %s\n", errmsg); #endif return(0); } -#endif /* XFREE86_VM */ +#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ -#ifdef XFREE86_DGAMOUSE +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE /* DGA errors can be non-fatal. :) */ if ( (dga_error >= 0) && ((e->error_code > dga_error) && @@ -219,7 +219,7 @@ printf("DGA error: %s\n", errmsg); #endif return(0); } -#endif /* XFREE86_DGAMOUSE */ +#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */ return(X_handler(d,e)); } @@ -451,7 +451,7 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat) local_X11 = 0; } SDL_Display = pXOpenDisplay(display); -#if defined(__osf__) && defined(X11_DYNAMIC) +#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC) /* On Tru64 if linking without -lX11, it fails and you get following message. * Xlib: connection to ":0.0" refused by server * Xlib: XDM authorization key matches an existing client! diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index e5dad3ee..71f02f99 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -27,20 +27,19 @@ #include <X11/Xutil.h> #include <X11/Xatom.h> -#ifdef XFREE86_DGAMOUSE -#include <Xext/extensions/xf86dga.h> +#include "SDL_mouse.h" +#include "../SDL_sysvideo.h" + +#if SDL_VIDEO_DRIVER_X11_DGAMOUSE +#include "../Xext/extensions/xf86dga.h" #endif -#ifdef XFREE86_VM -#include <Xext/extensions/xf86vmode.h> +#if SDL_VIDEO_DRIVER_X11_VIDMODE +#include "../Xext/extensions/xf86vmode.h" #endif -#ifdef HAVE_XIGXME -#include <Xext/extensions/xme.h> +#if SDL_VIDEO_DRIVER_X11_XME +#include "../Xext/extensions/xme.h" #endif -#include <string.h> - -#include "SDL_mouse.h" -#include "SDL_sysvideo.h" #include "SDL_x11dyn.h" /* Hidden "this" pointer for the video functions */ @@ -106,13 +105,13 @@ struct SDL_PrivateVideoData { int depth; /* current visual depth (not bpp) */ /* Variables used by the X11 video mode code */ -#ifdef XFREE86_VM +#if SDL_VIDEO_DRIVER_X11_VIDMODE SDL_NAME(XF86VidModeModeInfo) saved_mode; struct { int x, y; } saved_view; #endif -#ifdef HAVE_XIGXME /* XiG XME fullscreen */ +#if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */ int use_xme; XiGMiscResolutionInfo saved_res; #endif diff --git a/src/video/x11/SDL_x11wm.c b/src/video/x11/SDL_x11wm.c index bf76fd99..2efc3f02 100644 --- a/src/video/x11/SDL_x11wm.c +++ b/src/video/x11/SDL_x11wm.c @@ -27,8 +27,8 @@ #include "SDL_timer.h" #include "SDL_video.h" #include "SDL_syswm.h" -#include "SDL_events_c.h" -#include "SDL_pixels_c.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_x11modes_c.h" #include "SDL_x11wm_c.h" diff --git a/src/video/x11/SDL_x11yuv.c b/src/video/x11/SDL_x11yuv.c index 730dacef..247d3636 100644 --- a/src/video/x11/SDL_x11yuv.c +++ b/src/video/x11/SDL_x11yuv.c @@ -22,7 +22,9 @@ /* This is the XFree86 Xv extension implementation of YUV video overlays */ -#ifdef XFREE86_XV +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_X11_XV #include <X11/Xlib.h> #ifndef NO_SHARED_MEMORY @@ -30,11 +32,10 @@ #include <sys/shm.h> #include <X11/extensions/XShm.h> #endif -#include <Xext/extensions/Xvlib.h> +#include "../Xext/extensions/Xvlib.h" -#include "SDL_video.h" #include "SDL_x11yuv_c.h" -#include "SDL_yuvfuncs.h" +#include "../SDL_yuvfuncs.h" #define XFREE86_REFRESH_HACK #ifdef XFREE86_REFRESH_HACK @@ -407,4 +408,4 @@ void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay) #endif } -#endif /* XFREE86_XV */ +#endif /* SDL_VIDEO_DRIVER_X11_XV */ diff --git a/src/video/x11/SDL_x11yuv_c.h b/src/video/x11/SDL_x11yuv_c.h index b435216c..874e6045 100644 --- a/src/video/x11/SDL_x11yuv_c.h +++ b/src/video/x11/SDL_x11yuv_c.h @@ -25,7 +25,7 @@ #include "SDL_video.h" #include "SDL_x11video.h" -#ifdef XFREE86_XV +#if SDL_VIDEO_DRIVER_X11_XV extern SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); @@ -37,4 +37,4 @@ extern int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect) extern void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay); -#endif /* XFREE86_XV */ +#endif /* SDL_VIDEO_DRIVER_X11_XV */ diff --git a/src/video/xbios/Makefile.am b/src/video/xbios/Makefile.am deleted file mode 100644 index b5b0185a..00000000 --- a/src/video/xbios/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -## Makefile.am for SDL using the XBIOS video driver - -noinst_LTLIBRARIES = libvideo_xbios.la -libvideo_xbios_la_SOURCES = $(XBIOS_SRCS) - -# The SDL XBIOS video driver sources -XBIOS_SRCS = \ - SDL_xbios.c \ - SDL_xbios.h \ - SDL_xbios_blowup.c \ - SDL_xbios_blowup.h \ - SDL_xbios_centscreen.c \ - SDL_xbios_centscreen.h \ - SDL_xbios_sb3.c \ - SDL_xbios_sb3.h diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index 730f3df5..8ff6b17c 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -36,9 +36,9 @@ #include "SDL_video.h" #include "SDL_mouse.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_events_c.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" #include "SDL_ataric2p_s.h" #include "SDL_atarievents_c.h" @@ -78,7 +78,7 @@ static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface); static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface); static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* OpenGL functions */ static void XBIOS_GL_SwapBuffers(_THIS); #endif @@ -174,7 +174,7 @@ static SDL_VideoDevice *XBIOS_CreateDevice(int devindex) device->FlipHWSurface = XBIOS_FlipHWSurface; device->FreeHWSurface = XBIOS_FreeHWSurface; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL /* OpenGL functions */ device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary; device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress; @@ -452,7 +452,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat) /* Init chunky to planar routine */ SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL SDL_AtariGL_InitPointers(this); #endif @@ -566,7 +566,7 @@ static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL); -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (flags & SDL_OPENGL) { if (this->gl_config.double_buffer) { flags |= SDL_DOUBLEBUF; @@ -610,7 +610,7 @@ static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, XBIOS_fbnum = 0; -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (flags & SDL_OPENGL) { if (!SDL_AtariGL_Init(this, current)) { XBIOS_FreeBuffers(this); @@ -891,7 +891,7 @@ static void XBIOS_VideoQuit(_THIS) #endif -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL if (gl_active) { SDL_AtariGL_Quit(this, SDL_TRUE); } @@ -922,7 +922,7 @@ static void XBIOS_VideoQuit(_THIS) this->screen->pixels = NULL; } -#ifdef HAVE_OPENGL +#if SDL_VIDEO_OPENGL static void XBIOS_GL_SwapBuffers(_THIS) { diff --git a/src/video/xbios/SDL_xbios.h b/src/video/xbios/SDL_xbios.h index 82f52ce4..8355c2d2 100644 --- a/src/video/xbios/SDL_xbios.h +++ b/src/video/xbios/SDL_xbios.h @@ -24,7 +24,7 @@ #define _SDL_xbios_h #include "SDL_stdinc.h" -#include "SDL_sysvideo.h" +#include "../SDL_sysvideo.h" /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this |