编译与安装

此页有脚本错误。在网站编辑解决此问题前,你可以查看以上的部分内容。

NOTE: Do not make substantive changes to this document without consulting Benjamin Smedberg <benjamin@smedbergs.us> or one of the build-config peers.

注意: 不要在配置你的编译选项前进行编译工作!

{{ :cn/Build_Documentation/TOC }}

编译

你必须使用GNU make工具去检验和build Mozilla。没有其它的"make"工具可以使用。在Windwos和Mac平台。使用"make"工具运行GNU make;在大多数的类unix系统,使用"gmake"工具。

$ gmake -f client.mk build

如果你想手工配置和build。首先进入你的objdir目录。运行configure,然后运行gmake。但是Configure将仍然使用你在.mozconfig文件中所指定的设置.

Running Your New Build

It is possible to run your new build directly from the directory in which it was built. However, the build directory contains symlinks into the build tree; you must run the installation/packaging step to produce a standalone build which can be shared or moved.

Windows and Linux

On non-macintosh build system, the finished build can be found in objdir/dist/bin. On *nix platforms, you should run the file "mozilla" or "firefox", not the binary "mozilla-bin" or "firefox-bin".

Mac OS X

On macintosh, the build system produces an application bundle at objdir/dist/AppName.app, for example objdir/dist/DeerPark.app.

Please note that when you are building with <tt>--enable-debug</tt>, the application is placed in objdir/dist/AppNameDebug.app, e.g. objdir/dist/DeerParkDebug.app.

You can run the application by either opening the application bundle via the Finder, or from the command line using

$ objdir/dist/AppName[Debug].app/Contents/MacOS/appname

for instance

$ objdir/dist/DeerParkDebug.app/Contents/MacOS/firefox

Installing Your Build

On *nix platforms, you can install your build to the system by running gmake install. However, it is often better to follow the steps below to make a tarball, then unpack the tarball.

For most apps, prepare a tarball/zip of your build by making in an app-specific directory:

  • Firefox: <tt>$ gmake -C objdir/browser/installer</tt>
  • Thunderbird: <tt>$ gmake -C objdir/mail/installer</tt>
  • SeaMonkey: <tt>$ gmake -C objdir/xpinstall/packager</tt>

To make a windows installer, make the "installer" target in the above directory:

  • Firefox: <tt>$ gmake -C objdir/browser/installer installer</tt>
  • Thunderbird: <tt>$ gmake -C objdir/mail/installer installer</tt>
  • SeaMonkey: <tt>$ gmake -C objdir/xpinstall/packager installer</tt>

NOTE: To make the highly compressed installer used by Firefox and Thunderbird, you must install a few additional programs:

Both of these utilities must exist in the PATH. In addition, MOZ_INSTALLER_USE_7ZIP must be exported in your environment.

Document Tags and Contributors

Contributors to this page: Klp99, Dbseti, Mosesofmason, Mgjbot
最后编辑者: Mgjbot,