Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
participation_au_projet:programmation:compilation_du_client [13/05/2010 20:20] trinita |
participation_au_projet:programmation:compilation_du_client [19/08/2015 12:05] (Version actuelle) burno [Compilation du client sous Windows] |
||
---|---|---|---|
Ligne 17: | Ligne 17: | ||
REP_SOURCES="/opt/landes/NouveauClient/trunk/client_sources/" | REP_SOURCES="/opt/landes/NouveauClient/trunk/client_sources/" | ||
REP_LIBS="$REP_SOURCES/libs" | REP_LIBS="$REP_SOURCES/libs" | ||
- | OPENAL="openal-soft-1.7.411" | + | OPENAL="openal-soft-1.11.753" |
CAL3D="cal3d_0.10.0+0.11.0+rc2" | CAL3D="cal3d_0.10.0+0.11.0+rc2" | ||
- | SDL="SDL-1.2.13" | + | SDL="SDL-1.2.14" |
- | SDL_IMAGE="SDL_image-1.2.7" | + | SDL_IMAGE="SDL_image-1.2.10" |
SDL_NET="SDL_net-1.2.7" | SDL_NET="SDL_net-1.2.7" | ||
- | VORBIS="libvorbis-1.2.0" | + | VORBIS="libvorbis-1.3.1" |
- | OGG="libogg-1.1.3" | + | OGG="libogg-1.2.0" |
- | XML="libxml2-2.7.3" | + | XML="libxml2-2.7.8" |
- | PNG="libpng-1.2.43" | + | PNG="libpng-1.4.5" |
- | ALSA="alsa-lib-1.0.19" | + | ALSA="alsa-lib-1.0.21a" |
+ | ZLIB="zlib-1.2.5" | ||
if [ ! -e "$REP_LIBS" ]; then | if [ ! -e "$REP_LIBS" ]; then | ||
Ligne 37: | Ligne 38: | ||
# Compilation de OpenAL # | # Compilation de OpenAL # | ||
######################### | ######################### | ||
- | wget http://kcat.strangesoft.net/openal-releases/$OPENAL.tar.bz2 | + | if [ ! -f $OPENAL.tar.bz2 ]; then |
- | tar xjf $OPENAL.tar.bz2 | + | wget http://kcat.strangesoft.net/openal-releases/$OPENAL.tar.bz2 |
- | cd $OPENAL | + | fi |
- | sed -i 's/SHARED/STATIC/' CMakeLists.txt | + | |
- | cd CMakeConf/ | + | if [ ! -e $OPENAL ]; then |
- | cmake .. | + | tar xjf $OPENAL.tar.bz2 |
- | make | + | fi |
- | cp libopenal.a ../../ | + | |
- | cd $REP_LIBS | + | if [ ! -f libopenal.a ]; then |
+ | cd $OPENAL | ||
+ | sed -i 's/SHARED/STATIC/' CMakeLists.txt | ||
+ | cmake . | ||
+ | make | ||
+ | cp libopenal.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
######################## | ######################## | ||
# Compilation de Cal3D # | # Compilation de Cal3D # | ||
######################## | ######################## | ||
- | wget http://download.gna.org/cal3d/cal3d/gnulinux/debian/dapper/src/$CAL3D.orig.tar.gz | + | if [ ! -f $CAL3D.orig.tar.gz ]; then |
- | tar xzf $CAL3D.orig.tar.gz | + | wget http://download.gna.org/cal3d/cal3d/gnulinux/debian/dapper/src/$CAL3D.orig.tar.gz |
- | cd cal3d-0.10.0+0.11.0+rc2 | + | fi |
- | ./configure --enable-static --disable-shared | + | |
- | echo "#include <string.h>" >> config.h | + | if [ ! -e cal3d-0.10.0+0.11.0+rc2 ]; then |
- | make | + | tar xzf $CAL3D.orig.tar.gz |
- | cp src/cal3d/.libs/libcal3d.a ../ | + | fi |
- | cd $REP_LIBS | + | |
+ | if [ ! -f libcal3d.a ]; then | ||
+ | cd cal3d-0.10.0+0.11.0+rc2 | ||
+ | ./configure --enable-static --disable-shared | ||
+ | echo "#include <string.h>" >> config.h | ||
+ | make | ||
+ | cp src/cal3d/.libs/libcal3d.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
###################### | ###################### | ||
# Compilation de SDL # | # Compilation de SDL # | ||
###################### | ###################### | ||
- | wget http://www.libsdl.org/release/$SDL.tar.gz | + | if [ ! -f $SDL.tar.gz ]; then |
- | tar xzf $SDL.tar.gz | + | wget http://www.libsdl.org/release/$SDL.tar.gz |
- | cd $SDL | + | fi |
- | ./configure --disable-shared --disable-video-directfb | + | |
- | make | + | if [ ! -e $SDL ]; then |
- | cp build/.libs/libSDL.a ../ | + | tar xzf $SDL.tar.gz |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libSDL.a ]; then | ||
+ | cd $SDL | ||
+ | ./configure --disable-shared --disable-video-directfb | ||
+ | make | ||
+ | cp build/.libs/libSDL.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
############################ | ############################ | ||
# Compilation de SDL_image # | # Compilation de SDL_image # | ||
############################ | ############################ | ||
- | wget http://www.libsdl.org/projects/SDL_image/release/$SDL_IMAGE.tar.gz | + | if [ ! -f $SDL_IMAGE.tar.gz ]; then |
- | tar xzf $SDL_IMAGE.tar.gz | + | wget http://www.libsdl.org/projects/SDL_image/release/$SDL_IMAGE.tar.gz |
- | cd $SDL_IMAGE | + | fi |
- | ./configure --disable-shared | + | |
- | make | + | if [ ! -e $SDL_IMAGE ]; then |
- | cp .libs/libSDL_image.a ../ | + | tar xzf $SDL_IMAGE.tar.gz |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libSDL_image.a ]; then | ||
+ | cd $SDL_IMAGE | ||
+ | ./configure --disable-shared | ||
+ | make | ||
+ | cp .libs/libSDL_image.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
########################## | ########################## | ||
# Compilation de SDL_net # | # Compilation de SDL_net # | ||
########################## | ########################## | ||
- | wget http://www.libsdl.org/projects/SDL_net/release/$SDL_NET.tar.gz | + | if [ ! -f $SDL_NET.tar.gz ]; then |
- | tar xzf $SDL_NET.tar.gz | + | wget http://www.libsdl.org/projects/SDL_net/release/$SDL_NET.tar.gz |
- | cd $SDL_NET | + | fi |
- | ./configure --disable-shared | + | |
- | make | + | if [ ! -e $SDL_NET ]; then |
- | cp .libs/libSDL_net.a ../ | + | tar xzf $SDL_NET.tar.gz |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libSDL_net.a ]; then | ||
+ | cd $SDL_NET | ||
+ | ./configure --disable-shared | ||
+ | make | ||
+ | cp .libs/libSDL_net.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
######################### | ######################### | ||
# Compilation de Vorbis # | # Compilation de Vorbis # | ||
######################### | ######################### | ||
- | wget http://downloads.xiph.org/releases/vorbis/$VORBIS.tar.gz | + | if [ ! -f $VORBIS.tar.gz ]; then |
- | tar xzf $VORBIS.tar.gz | + | wget http://downloads.xiph.org/releases/vorbis/$VORBIS.tar.gz |
- | cd $VORBIS | + | fi |
- | ./configure --disable-shared --enable-static | + | |
- | make | + | if [ ! -e $VORBIS ]; then |
- | cp lib/.libs/libvorbis.a ../ | + | tar xzf $VORBIS.tar.gz |
- | cp lib/.libs/libvorbisfile.a ../ | + | fi |
- | cd $REP_LIBS | + | |
+ | if [ ! -f libvorbis.a ]; then | ||
+ | cd $VORBIS | ||
+ | ./configure --disable-shared --enable-static | ||
+ | make | ||
+ | cp lib/.libs/libvorbis.a ../ | ||
+ | cp lib/.libs/libvorbisfile.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
###################### | ###################### | ||
# Compilation de Ogg # | # Compilation de Ogg # | ||
###################### | ###################### | ||
- | wget http://downloads.xiph.org/releases/ogg/$OGG.tar.gz | + | if [ ! -f $OGG.tar.gz ]; then |
- | tar xzf $OGG.tar.gz | + | wget http://downloads.xiph.org/releases/ogg/$OGG.tar.gz |
- | cd $OGG | + | fi |
- | ./configure --disable-shared --enable-static | + | |
- | make | + | if [ ! -e $OGG ]; then |
- | cp src/.libs/libogg.a ../ | + | tar xzf $OGG.tar.gz |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libogg.a ]; then | ||
+ | cd $OGG | ||
+ | ./configure --disable-shared --enable-static | ||
+ | make | ||
+ | cp src/.libs/libogg.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
###################### | ###################### | ||
# Compilation de XML # | # Compilation de XML # | ||
###################### | ###################### | ||
- | wget ftp://xmlsoft.org/libxml2/$XML.tar.gz | + | if [ ! -f $XML.tar.gz ]; then |
- | tar xzf $XML.tar.gz | + | wget ftp://xmlsoft.org/libxml2/$XML.tar.gz |
- | cd $XML | + | fi |
- | ./configure --disable-shared --enable-static | + | |
- | make | + | if [ ! -e $XML ]; then |
- | cp .libs/libxml2.a ../ | + | tar xzf $XML.tar.gz |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libxml2.a ]; then | ||
+ | cd $XML | ||
+ | ./configure --disable-shared --enable-static | ||
+ | make | ||
+ | cp .libs/libxml2.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
###################### | ###################### | ||
# Compilation de PNG # | # Compilation de PNG # | ||
###################### | ###################### | ||
- | wget ftp://ftp.simplesystems.org/pub/libpng/png/src/$PNG.tar.bz2 | + | if [ ! -f $PNG.tar.bz2 ]; then |
- | tar xjf $PNG.tar.bz2 | + | wget ftp://ftp.simplesystems.org/pub/libpng/png/src/history/$PNG.tar.bz2 |
- | cd $PNG | + | fi |
- | ./configure --disable-shared --enable-static | + | |
- | make | + | if [ ! -e $PNG ]; then |
- | cp .libs/libpng.a ../ | + | tar xjf $PNG.tar.bz2 |
- | cd $REP_LIBS | + | fi |
+ | |||
+ | if [ ! -f libpng.a ]; then | ||
+ | cd $PNG | ||
+ | ./configure --disable-shared --enable-static | ||
+ | make | ||
+ | cp .libs/libpng14.a ../libpng.a | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
####################### | ####################### | ||
# Compilation de ALSA # | # Compilation de ALSA # | ||
####################### | ####################### | ||
- | wget ftp://ftp.task.gda.pl/pub/linux/misc/alsa/lib/$ALSA.tar.bz2 | + | if [ ! -f $ALSA.tar.bz2 ]; then |
- | tar xjf $ALSA.tar.bz2 | + | wget ftp://ftp.task.gda.pl/pub/linux/misc/alsa/lib/$ALSA.tar.bz2 |
- | cd $ALSA | + | fi |
- | ./configure --disable-shared --enable-static | + | |
- | make | + | |
- | cp src/.libs/libasound.a ../ | + | |
- | cd $REP_LIBS | + | |
- | </code> | + | |
+ | if [ ! -e $ALSA ]; then | ||
+ | tar xjf $ALSA.tar.bz2 | ||
+ | fi | ||
+ | |||
+ | if [ ! -f libasound.a ]; then | ||
+ | cd $ALSA | ||
+ | ./configure --disable-shared --enable-static | ||
+ | make | ||
+ | cp src/.libs/libasound.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
+ | |||
+ | |||
+ | ####################### | ||
+ | # Compilation de ZLIB # | ||
+ | ####################### | ||
+ | if [ ! -f $ZLIB.tar.bz2 ]; then | ||
+ | wget http://zlib.net/$ZLIB.tar.bz2 | ||
+ | fi | ||
+ | |||
+ | if [ ! -e $ZLIB ]; then | ||
+ | tar xjf $ZLIB.tar.bz2 | ||
+ | fi | ||
+ | |||
+ | if [ ! -f libz.a ]; then | ||
+ | cd $ZLIB | ||
+ | ./configure | ||
+ | make | ||
+ | cp libz.a ../ | ||
+ | cd $REP_LIBS | ||
+ | fi | ||
+ | </code> | ||
Lorsque toutes les bibliothèques sont récupérer, il faut taper la commande ''make static -f Makefile.linux'', ce qui va compiler les sources et créer le fichier ''le.x86.static.linux.bin''. Pour diminuer la taille de l'exécutable, il faut taper la commande ''strip le.x86.static.linux.bin''. | Lorsque toutes les bibliothèques sont récupérer, il faut taper la commande ''make static -f Makefile.linux'', ce qui va compiler les sources et créer le fichier ''le.x86.static.linux.bin''. Pour diminuer la taille de l'exécutable, il faut taper la commande ''strip le.x86.static.linux.bin''. | ||
Ligne 179: | Ligne 278: | ||
Le fichier projet le plus à jour étant celui sous Code::Blocks, nous vous recommandons d'utiliser ce logiciel. | Le fichier projet le plus à jour étant celui sous Code::Blocks, nous vous recommandons d'utiliser ce logiciel. | ||
- | Téléchargement (Celui avec mingw) : http://www.codeblocks.org/downloads/5 | + | Téléchargez celui avec mingw, version 10.05 (les plus récentes ne sont pas compatibles). |
Ligne 185: | Ligne 284: | ||
Il vous faut aussi récupérer les librairies Windows, la version officielle du pack est disponible ici : http://landes-eternelles.com/client/Librairie.zip | Il vous faut aussi récupérer les librairies Windows, la version officielle du pack est disponible ici : http://landes-eternelles.com/client/Librairie.zip | ||
- | Dézipez ces deux dossiers et mettez-les dans un même répertoire. Vous vous retrouverez donc avec un dossier contenant deux autres dossiers : client_sources et librairies. | + | Dézipez ces deux dossiers et mettez-les dans un même répertoire. Vous vous retrouverez donc avec un dossier contenant deux autres dossiers : client_sources et Librairie. |
Il vous suffit ensuite d'aller dans votre fichier source, d'ouvrir le fichier client.cdb et de lancer la compilation (construire l'exécutable). | Il vous suffit ensuite d'aller dans votre fichier source, d'ouvrir le fichier client.cdb et de lancer la compilation (construire l'exécutable). | ||
Ligne 191: | Ligne 290: | ||
Placez client.exe dans votre répertoire de jeu, double cliquez dessus, et le jeu se lancera à partir du client que vous venez de créer. | Placez client.exe dans votre répertoire de jeu, double cliquez dessus, et le jeu se lancera à partir du client que vous venez de créer. | ||
+ | |||
+ | |||
+ | Problème fréquent : "redefinition of typedef 'Byte'" => déplacer le fichier xz\Type.h dans les includes de code blocks (généralement C:\Program Files (x86)\CodeBlocks\MinGW\include) | ||
==== Activation d'un flag ==== | ==== Activation d'un flag ==== | ||
Ligne 197: | Ligne 299: | ||
Menu Project / Build Options / Onglet Compiler Settings / Onglet #define / => rajouter les variables qui vont bien | Menu Project / Build Options / Onglet Compiler Settings / Onglet #define / => rajouter les variables qui vont bien | ||
+ | |||
+ | ===== Compilation sous mac avec xcode ===== | ||
+ | |||
+ | Pour compiler sur mac vous devez déjà connaitre l'environnement mac et xcode. Vous pouvez contacter Trinita pour plus d'informations. | ||
+ | |||
+ | 1. vous pouvez récupérer le pack de librairie ici : http://landes-eternelles.com/client/framework_macosx.zip | ||
+ | |||
+ | 2. vous devez installer xcode ( voir le site apple.fr ) | ||
+ | |||
+ | 3. vous devez récupérer les sources ( soit le zip sur dans la partie téléchargement ) soit sur le svn. Vous pouvez utiliser SvnX comme interface graphique. | ||
+ | |||
+ | |||