Cette traduction est incomplète. Aidez à traduire cet article depuis l'anglais.
Cette page détaille les étapes nécessaires pour compiler la toute dernière version en cours de développement de Thunderbird. Pour plus de détails, voir la documentation détaillée.
Pré-requis
Spécifications matérielles
- Recommandé : 4 Gio de mémoire RAM (2 Gio RAM et 2 Gio swap peut générer des erreurs à la compilation)
- Connexion haut débit
Installation
La procédure d'installation diffère selon votre système d'exploitation. D'abord, réalisez les instructions pour votre OS et ensuite, revenez aux instruction de compilation. Notez que pour les compilations sous Linux/MacOS, vous devriez suivre la procédure de clonage des sources qui est sur cette page.
Prérequis de compilation pour Windows [en-US]
Prérequis de compilation pour Linux/MacOS [en-US]
Obtenir le code source
Récuperez la dernière version du code source depuis les dépôts Mercurial comm-central
de Mozilla :
hg clone https://hg.mozilla.org/comm-central
Ensuite, récuperez toutes ses dépendances. Le dépôt comm-central contient un script pour faire cela. Cela peut prendre du temps, Il y a beaucoup de choses à faire ! Pour ça, descendez dans le sous-dossier comm-
central
(créé automatiquement par la commande précédente):
cd comm-central
Ensuite lancez :
python client.py checkout
Le code source requiert 3.2 Gio ou plus d'espace disque et de 5 Gio supplémentaires pour un build par défaut.
Pour en savoir plus sur le code source et sa récupération, voir Récupérer le code source comm-central depuis Mercurial [en-US].
Configuration de compilation
Pour compiler thunderbird, vous devez créer un fichier .mozconfig
dans le dossier comm-central et d'y ajouter la ligne suivante :
ac_add_options --enable-application=mail
Si vous oubliez cette ligne, vous allez compiler Firefox à la place. D'autres d'options configuration peuvent être ajoutées dans ce fichier bien qu'il soit fortement recommandé de n'utiliser que des options dont vous avez completement compris la signification. Par exemple, pour compiler en mode "debug" au lieu du mode "release", rajoutez :
ac_add_options --enable-debug
For more on configuration options, see the page Configuring build options. Note that if you use an MOZ_OBJDIR it cannot be a sibling folder to your source directory. Use an absolute path to be sure!
OS X 10.9/10.10 Notice
Because of an issue with the 10.9 OS X SDK, you must use an earlier SDK version. To do this add the following to your .mozconfig:
ac_add_options --with-macos-sdk=path/to/older/sdk
The path to the SDKs are usually located at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/.
Building Thunderbird
Before you start, make sure that the version you checked out is not busted. For hg tip, you should see green Bs on https://treeherder.mozilla.org/ui/#/jobs?repo=comm-central
To start the build, cd into the comm-central
subdirectory (created automatically by the hg clone
command), and run:
./mozilla/mach build
mach is our command-line tool to streamline common developer tasks. See the mach article for more.
Building can take a significant amount of time, depending on your system, OS, and chosen build options. Linux builds on a fast box may take under 15 minutes, but Windows builds on a slow box may take several hours. Tips for making builds faster.
The executable will be at the location listed under Running below.
Building Thunderbird and Lightning
If you've set up your build environment as above, then all you need to do is:
echo 'ac_add_options --enable-calendar' >> .mozconfig
in the comm-central
directory, or just add the ac_add_options --enable-calendar
line to your .mozconfig with your favorite editor.
Then just re-run the mach command above (you can do the addition before running make for the first time).
Running
Various temporary files, libraries, and the Thunderbird executable will be found in your object directory (under comm-central/
), which is prefixed with obj-
. The exact name depends on your system and OS. For example, a Mac user may get an object directory name of obj-x86_64-apple-darwin10.7.3/
.
The Thunderbird executable in particular, and its dependencies, are located under the dist/bin
folder under the object directory. To run the executable from your comm-central
working directory:
- Windows:
obj-.../dist/bin/thunderbird.exe
- Linux:
obj-.../dist/bin/thunderbird
- OS X:
obj-.../dist/Daily.app/Contents/MacOS/thunderbird
How to update and build again
In your comm-central
directory, run the same command as before:
python client.py checkout
Then just re-run the mach command above. This will only recompile files that changed, but it's still a long haul.
Rebuilding
To build after making changes, run
./mozilla/mach build
again. This will only rebuild what is necessary for these changes. It is also possible to use
./mach build path/to/dir
to build parts of the tree. However, this approach may or may not yield correct results, so it is not recommended.
It is important to specify the correct path (obviously):
For code under /mozilla, for example in the spellchecker, run
./mozilla/mach build extensions/spellcheck/src
without /mozilla in the path. For code outside the /mozilla directory, specify the complete relative path, for example run
./mozilla/mach build mailnews/import/outlook/src
Problems Building?
Have you:
- Checked comm-central on Treeherder for known failures at the time you pulled the code?
- If the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction).
- On Windows: Checked that the MAPI header files from https://www.microsoft.com/en-us/download/details.aspx?id=12905 are installed because the MAPI header files are not bundled with Visual Studio 2013 (Windows SDK 8.1). You should copy the header files to a Windows SDK include directory so that the build process will find the files, for example to
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
. - Checked to make sure that the path in which you placed the source code has no spaces, and is not too long?
- Have you searched the bug database for issues relating to your problem (e.g., platform-specific issues)?
- Try asking in mozilla.dev.builds - don't forget to include details of what is in your mozconfig, and what the actual error is.
- Did you make mozilla/ a symlink? That doesn't work.
- Do you have
@TOPSRCDIR@
or relative paths in your mozconfig? Those have caused several problems historically and tend to be poorly tested when the build system changes.