Skip to content
Snippets Groups Projects
Commit be654ae9 authored by Montjoie Henri's avatar Montjoie Henri
Browse files

ajout de la librairie SDL

parent 9f2a3d1c
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 13176 additions and 0 deletions
Simple DirectMedia Layer
(SDL)
Version 1.2
---
http://www.libsdl.org/
This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS,
MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX,
and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially
supported.
SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
Pike, Pliant, Python, Ruby, and Smalltalk.
This library is distributed under GNU LGPL version 2, which can be
found in the file "COPYING". This license allows you to use SDL
freely in commercial programs as long as you link with the dynamic
library.
The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation is available in HTML format in "docs/index.html", and
a documentation wiki is available online at:
http://www.libsdl.org/cgi/docwiki.cgi
The test programs in the "test" subdirectory are in the public domain.
Frequently asked questions are answered online:
http://www.libsdl.org/faq.php
If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
http://www.libsdl.org/mailing-list.php
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
designed to make it easy to write multi-media software, such as games and
emulators.
The Simple DirectMedia Layer library source code is available from:
http://www.libsdl.org/
This library is distributed under the terms of the GNU LGPL license:
http://www.gnu.org/copyleft/lesser.html
This diff is collapsed.
File added
File added
#!/bin/sh
prefix=/usr/local/cross-tools/i686-w64-mingw32
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${exec_prefix}/lib
usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
#usage="\
#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 1.2.15
;;
--cflags)
echo -I${prefix}/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main
;;
--libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDLmain -lSDL -mwindows
;;
# --static-libs)
## --libs|--static-libs)
# echo -L${exec_prefix}/lib -lmingw32 -lSDLmain -lSDL -mwindows -lm -luser32 -lgdi32 -lwinmm -ldxguid
# ;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
File added
File added
File added
File added
File added
File added
File added
File added
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
#
# Build a fat binary on Mac OS X, thanks Ryan!
# Number of CPUs (for make -j)
NCPU=`sysctl -n hw.ncpu`
if test x$NJOB = x; then
NJOB=$NCPU
fi
# SDK path
if test x$SDK_PATH = x; then
SDK_PATH=/Developer/SDKs
fi
# Generic, cross-platform CFLAGS you always want go here.
CFLAGS="-O3 -g -pipe"
# We dynamically load X11, so using the system X11 headers is fine.
BASE_CONFIG_FLAGS="--build=`uname -p`-apple-darwin \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
# PowerPC 32-bit compiler flags
CONFIG_PPC="--host=powerpc-apple-darwin"
CC_PPC="gcc-4.0"
CXX_PPC="g++-4.0"
BUILD_FLAGS_PPC="-arch ppc -mmacosx-version-min=10.4"
# Intel 32-bit compiler flags
CONFIG_X86="--host=i386-apple-darwin"
CC_X86="gcc"
CXX_X86="g++"
BUILD_FLAGS_X86="-arch i386 -mmacosx-version-min=10.4"
# Intel 64-bit compiler flags
CONFIG_X64="--host=x86_64-apple-darwin"
CC_X64="gcc"
CXX_X64="g++"
BUILD_FLAGS_X64="-arch x86_64 -mmacosx-version-min=10.6"
#
# Find the configure script
#
srcdir=`dirname $0`/..
auxdir=$srcdir/build-scripts
cd $srcdir
allow_ppc="yes"
which gcc-4.0 >/dev/null 2>/dev/null
if [ "x$?" = "x1" ]; then
#echo "WARNING: Can't find gcc-4.0, which means you don't have Xcode 3."
#echo "WARNING: Therefore, we can't do PowerPC support."
allow_ppc="no"
fi
#
# Figure out which phase to build:
# all,
# configure, configure-ppc, configure-x86, configure-x64
# make, make-ppc, make-x86, make-x64, merge
# install
# clean
if test x"$1" = x; then
phase=all
else
phase="$1"
fi
case $phase in
all)
configure_ppc="$allow_ppc"
configure_x86="yes"
configure_x64="yes"
make_ppc="$allow_ppc"
make_x86="yes"
make_x64="yes"
merge="yes"
;;
configure)
configure_ppc="$allow_ppc"
configure_x86="yes"
configure_x64="yes"
;;
configure-ppc)
configure_ppc="$allow_ppc"
;;
configure-x86)
configure_x86="yes"
;;
configure-x64)
configure_x64="yes"
;;
make)
make_ppc="$allow_ppc"
make_x86="yes"
make_x64="yes"
merge="yes"
;;
make-ppc)
make_ppc="$allow_ppc"
;;
make-x86)
make_x86="yes"
;;
make-x64)
make_x64="yes"
;;
merge)
merge="yes"
;;
install)
install_bin="yes"
install_hdrs="yes"
install_lib="yes"
install_data="yes"
install_man="yes"
;;
install-bin)
install_bin="yes"
;;
install-hdrs)
install_hdrs="yes"
;;
install-lib)
install_lib="yes"
;;
install-data)
install_data="yes"
;;
install-man)
install_man="yes"
;;
clean)
clean_ppc="yes"
clean_x86="yes"
clean_x64="yes"
;;
clean-ppc)
clean_ppc="yes"
;;
clean-x86)
clean_x86="yes"
;;
clean-x64)
clean_x64="yes"
;;
*)
echo "Usage: $0 [all|configure[-ppc|-x86|-x64]|make[-ppc|-x86|-x64]|merge|install|clean[-ppc|-x86|-x64]]"
exit 1
;;
esac
case `uname -p` in
*86)
native_path=x86
;;
*powerpc)
native_path=ppc
;;
x86_64)
native_path=x64
;;
*)
echo "Couldn't figure out native architecture path"
exit 1
;;
esac
#
# Create the build directories
#
for dir in build build/ppc build/x86 build/x64; do
if test -d $dir; then
:
else
mkdir $dir || exit 1
fi
done
#
# Build the PowerPC 32-bit binary
#
if test x$configure_ppc = xyes; then
(cd build/ppc && \
sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $BUILD_FLAGS_PPC $CFLAGS_PPC" LDFLAGS="$BUILD_FLAGS_PPC $LFLAGS_PPC") || exit 2
fi
if test x$make_ppc = xyes; then
(cd build/ppc && make -j$NJOB) || exit 3
fi
#
# Build the Intel 32-bit binary
#
if test x$configure_x86 = xyes; then
(cd build/x86 && \
sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $BUILD_FLAGS_X86 $CFLAGS_X86" LDFLAGS="$BUILD_FLAGS_X86 $LFLAGS_X86") || exit 2
fi
if test x$make_x86 = xyes; then
(cd build/x86 && make -j$NJOB) || exit 3
fi
#
# Build the Intel 64-bit binary
#
if test x$configure_x64 = xyes; then
(cd build/x64 && \
sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $BUILD_FLAGS_X64 $CFLAGS_X64" LDFLAGS="$BUILD_FLAGS_X64 $LFLAGS_X64") || exit 2
fi
if test x$make_x64 = xyes; then
(cd build/x64 && make -j$NJOB) || exit 3
fi
#
# Combine into fat binary
#
if test x$merge = xyes; then
output=.libs
sh $auxdir/mkinstalldirs build/$output
cd build
target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
(lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` &&
ln -sf $target $output/libSDL.dylib &&
lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
cp $native_path/build/.libs/libSDL.la $output &&
cp $native_path/build/.libs/libSDL.lai $output &&
cp $native_path/build/libSDL.la . &&
lipo -create -o $output/libSDLmain.a */build/.libs/libSDLmain.a &&
cp $native_path/build/.libs/libSDLmain.la $output &&
cp $native_path/build/.libs/libSDLmain.lai $output &&
cp $native_path/build/libSDLmain.la . &&
echo "Build complete!" &&
echo "Files can be found in the build directory.") || exit 4
cd ..
fi
#
# Install
#
do_install()
{
echo $*
$* || exit 5
}
if test x$prefix = x; then
prefix=/usr/local
fi
if test x$exec_prefix = x; then
exec_prefix=$prefix
fi
if test x$bindir = x; then
bindir=$exec_prefix/bin
fi
if test x$libdir = x; then
libdir=$exec_prefix/lib
fi
if test x$includedir = x; then
includedir=$prefix/include
fi
if test x$datadir = x; then
datadir=$prefix/share
fi
if test x$mandir = x; then
mandir=$prefix/man
fi
if test x$install_bin = xyes; then
do_install sh $auxdir/mkinstalldirs $bindir
do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config
fi
if test x$install_hdrs = xyes; then
do_install sh $auxdir/mkinstalldirs $includedir/SDL
for src in $srcdir/include/*.h; do \
file=`echo $src | sed -e 's|^.*/||'`; \
do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \
done
do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h
fi
if test x$install_lib = xyes; then
do_install sh $auxdir/mkinstalldirs $libdir
do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la
do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDLmain.la $libdir/libSDLmain.la
fi
if test x$install_data = xyes; then
do_install sh $auxdir/mkinstalldirs $datadir/aclocal
do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4
do_install sh $auxdir/mkinstalldirs $libdir/pkgconfig
do_install /usr/bin/install -m 644 build/$native_path/sdl.pc $libdir/pkgconfig/sdl.pc
fi
if test x$install_man = xyes; then
do_install sh $auxdir/mkinstalldirs $mandir/man3
for src in $srcdir/docs/man3/*.3; do \
file=`echo $src | sed -e 's|^.*/||'`; \
do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
done
fi
#
# Clean up
#
do_clean()
{
echo $*
$* || exit 6
}
if test x$clean_ppc = xyes; then
do_clean rm -r build/ppc
fi
if test x$clean_x86 = xyes; then
do_clean rm -r build/x86
fi
if test x$clean_x64 = xyes; then
do_clean rm -r build/x64
fi
This diff is collapsed.
This diff is collapsed.
#!/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"$output" = x; then
echo "SOURCES, INCLUDE, 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
else
: >$cache
for path in $base `echo $INCLUDE | sed 's|-I||g'`
do dep="$path/$file"
if test -f "$dep"; then
echo " $dep \\" >>$cache
search_deps $dep >>$cache
break
fi
done
fi
cat $cache
done
}
:>${output}.new
for src in $SOURCES
do echo "Generating dependencies for $src"
ext=`echo $src | sed 's|.*\.\(.*\)|\1|'`
obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"`
echo "\$(objects)/$obj: $src \\" >>${output}.new
# No search to be done with Windows resource files
if test x"$ext" != x"rc"; then
search_deps $src | sort | uniq >>${output}.new
fi
case $ext in
c) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
cc) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
m) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
asm) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) -I\$(srcdir)/src/hermes/ $src -o \$@
__EOF__
;;
S) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
rc) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --tag=RC --mode=compile \$(WINDRES) $src -o \$@
__EOF__
;;
*) echo "Unknown file extension: $ext";;
esac
echo "" >>${output}.new
done
mv ${output}.new ${output}
rm -f ${cache_prefix}*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment