File:  [mozdev] / books / www / chapters / appa.html
Revision 1.13: download - view: text, annotated - select for diffs - revision graph
Fri Apr 4 16:27:40 2003 UTC (16 years, 8 months ago) by cdn
Branches: MAIN
CVS tags: HEAD

    1:     <link rel="prev" href="" />
    2:     <link rel="next" href="" />
    4:     <style type="text/css">
    5:       div.c2 {font-weight: bold; text-align: center}
    6:       div.c1 {text-align: center}
    7:     </style>
    9:     <h2>Appendix A</h2>
   10:     <h1><a name="90096"></a> Getting and Building the Mozilla
   11:     Source</h1>
   12:     <p>One of the best things about using Mozilla as an application
   13:     development framework is that you don't need to get involved
   14:     with the Mozilla source code to create a Mozilla application. A
   15:     simple Mozilla binary that you download and install is the only
   16:     development platform you need. You can create and use most
   17:     procedures and samples described in this book with a
   18:     precompiled version of the browser.</p>
   19:     <p>The best way to get a working 
   20:     <!--INDEX precompiled versions for downloading --> 
   21:     <!--INDEX downloading:precompiled versions --> 
   22:     <!--INDEX Mozilla:precompiled versions, downloading --> version
   23:     of Mozilla quickly is to download a precompiled binary for your
   24:     platform. If you go to the homepage, you will find
   25:     links to Mozilla's most recent stable milestone build for each
   26:     platform and a link to the nightly development snapshot builds.
   27:     These binaries come as compressed archives or with an
   28:     installer, and you can use either to run Mozilla on your
   29:     computer within a few minutes. These binaries don't include the
   30:     source for Mozilla (unless you count the XUL, CSS, and
   31:     JavaScript that made up the front end, which are always
   32:     available), so read on if you want to obtain the code.</p>
   33:     <p>Under the relevant license terms, the Mozilla source code is
   34:     freely available to anyone who has an Internet connection and a
   35:     desire to explore. You may want to look at this code out of
   36:     curiosity or dive into the code as you figure out how it works
   37:     and can be improved. Whatever your reasons are for looking at
   38:     the Mozilla source, it is not much more difficult to get the
   39:     code and build it yourself than it is to download the
   40:     precompiled binaries. To get started, you need to know a few
   41:     things about how to get and use the source.</p>
   42:     <h2>Getting the Source Code</h2>
   43:     <p>You can get the Mozilla <!--INDEX source code:obtaining --> 
   44:     <!--INDEX Mozilla:source code:obtaining --> source code in a
   45:     few different ways. Depending on what you are interested in
   46:     doing, one method may work better for you than another. This
   47:     appendix provides basic information about how to get the
   48:     source, but you can also find information about this topic on
   49:     the Mozilla site at <a href=
   50:     ""></a><i>
   51:     .</i></p>
   52:     <p>If you want to look at the source code and don't intend to
   53:     recompile it, experiment with it, or update it at all, the best
   54:     way to get at the source is to browse the Mozilla code base
   55:     with Mozilla Cross Reference (LXR). As you can see in <a href=
   56:     "#73085">Figure A-1</a>, LXR is a web-based source code
   57:     browsing tool located at <i><a href=
   58:     ""></a></i>. LXR is
   59:     also hooked up to other tools, such as Bonsai (<i><a href=
   60:     ""></a></i>)
   61:     and the various tinderboxen (<i><a href=
   62:     ""></a></i>).
   63:     Together, these tools create a powerful code maintenance system
   64:     that is used widely by Mozilla developers.</p>
   65:     <div class="c1">
   66:       <img src="foo.gif">
   67:     </div>
   68:     <p><i>Figure A-1: <a name="73085"></a></i> <i>Mozilla Cross
   69:     Reference code browsing tool</i></p>
   70:     <h3>Downloading the Source with FTP</h3>
   71:     <p>If you would <!--INDEX source code:downloading with FTP --> 
   72:     <!--INDEX Mozilla:source code:downloading with FTP --> like to
   73:     get your hands on the code directly, use either File Transfer
   74:     Protocol (FTP) or Concurrent Versioning System (CVS) to grab
   75:     the source from the Mozilla site. Many people prefer to start
   76:     by grabbing an archive of the source code by FTP and then
   77:     working with CVS as they modify the code.</p>
   78:     <p>If you're sure you won't check your work back into Mozilla
   79:     and you just want to get the source, using FTP is the easiest
   80:     way to do so. The main FTP server is at <i><a href=
   81:     ""></a></i> (a list
   82:     of FTP mirrors is available on the site). To
   83:     download a particular version of Mozilla, go to either
   84:     <i>/pub/mozilla/nightly/latest/</i> or
   85:     <i>/pub/mozilla/releases/</i>, depending on which build you
   86:     would like to have.</p>
   87:     <p>When you download the source from the releases directory,
   88:     you get the code for the most recent Mozilla milestone. These
   89:     releases are versions of Mozilla that have been tested and
   90:     approved by developers at Milestones come out
   91:     about once a month and have some implied stability. The code in
   92:     the "latest" directory is for the version of Mozilla currently
   93:     under development. This code is not tested and stability is not
   94:     guaranteed. In fact, the latest code may not even work if
   95:     something that was checked in recently breaks Mozilla.</p>
   96:     <h3>Downloading the Source with CVS</h3>
   97:     <p>Grabbing the <!--INDEX source code:downloading with CVS --> 
   98:     <!--INDEX Mozilla:source code:downloading with CVS --> source
   99:     with CVS requires additional steps to get things set up
  100:     properly, but for many, it's worth the effort. If you would
  101:     like to contribute your own changes back to the community, you
  102:     must understand how CVS works. Pulling the source in this
  103:     manner is a good way to start learning about Mozilla
  104:     development.</p>
  105:     <p>For a quick understanding of CVS, you can obtain a copy of
  106:     the <i>CVS Pocket Reference</i> (O'Reilly). To pick up a binary
  107:     distribution of CVS if it isn't already installed, go to <i><a
  108:     href=
  109:     ""></a></i>,
  110:     where you'll also find links to documentation.</p>
  111:     <p>Using CVS requires logging into the Mozilla site by using a
  112:     CVS client, checking out the source code, modifying the source
  113:     code locally, and then checking the code back into the tree.
  114:     Anyone is free to check out the code, but you need special
  115:     permission to check in the changes you make to the source. This
  116:     chapter discusses only how to check out the source with
  117:     CVS.</p>
  118:     <p>You first need a CVS client. Free CVS clients are available
  119:     for most operating systems, including WinCVS on Windows and
  120:     MacCVS for the Mac. Linux has a command-line CVS client that
  121:     should come standard on most Linux distributions. Here are
  122:     instructions for using the Linux command-line client to check
  123:     out the source code:</p>
  124:     <ol>
  125:       <li>
  126:         Set the <i>CVSROOT</i> variable: 
  127: <pre>
  128: $ export
  129: </pre>
  130:       </li>
  131:       <li>
  132:         Log in using the password "anonymous":
  133:       </li>
  134: <pre>
  135: $ cvs login
  136: CVS password: anonymous
  137: </pre>
  138:       </li>
  139:       <li>
  140:         Check out the build Makefile:
  141: <pre>
  142: $ cvs checkout mozilla/
  143: U mozilla/
  144: </pre>
  145:       </li>
  146:       <li>
  147:         Run the Makefile script to get the files:
  148: <pre>
  149: $ cd mozilla
  150: $ make -f checkout
  151: </pre>
  152:       </li>
  153:     </ol>
  154:     <p>On Windows, the command-line interface used to obtain the
  155:     Mozilla source is very similar. You just need to make a few
  156:     small changes to the steps above for a Windows install. Here
  157:     are the steps listed for comparison:</p>
  158:     <ol>
  159:       <li>
  160:         Set the <i>CVSROOT</i> variable:
  161: <pre>
  162: &gt; set
  163: </pre>
  164:       </li>
  165:       <li>
  166:         Log in using the password "anonymous":
  167: <pre>
  168: &gt; cvs login
  169: CVS password: anonymous
  170: </pre>
  171:       </li>
  172:       <li>
  173:         Check out the build Makefile:
  174: <pre>
  175: &gt; cvs checkout mozilla/
  176: U mozilla/
  177: </pre>
  178:       </li>
  179:       <li>
  180:         Run the Makefile script to get the files:
  181: <pre>
  182: &gt; cd mozilla
  183: &gt; make -f checkout
  184: </pre>
  185:       </li>
  186:     </ol>
  187:     <p>In Step 1, set the <i>CVSROOT</i> environment variable using
  188:     the <tt>set</tt> command. Use the GNU <i>make</i> utility
  189:     (<i>make</i>) on Windows just as you would on Unix.</p>
  190:     <blockquote>
  191:       <div class="c2">
  192:         NOTE
  193:       </div>
  194:     </blockquote>
  195:     <blockquote>
  196:       <p>Building using nmake is no longer supported on the Mozilla
  197:       development trunk, though there is a document describing this
  198:       process for developers using older branches at <i><a href=
  199:       ""></a></i>.</p>
  200:     </blockquote>
  201:     <p>Before you pull the source code, check the tree status in
  202:     the relevant Tinderbox. Grab the source only if the tree is
  203:     green (success) or yellow (building). Do not pull the source on
  204:     red, which indicates that the build is broken.</p>
  205:     <p>To pull the Mozilla source code on 
  206:     <!--INDEX STARTRANGE==Macintosh:source installation -->
  207:     Macintosh, use a client like MacCVS, which automates much of
  208:     the CVS process for you. Mac OSX users can use the standard
  209:     command-line CVS client and pull the source using a method
  210:     similar to checking out the source in a Unix environment. Also
  211:     be sure to include the required resources-XML Perl modules,
  212:     MacPerl, or the CodeWarrior development environment--which are
  213:     all listed later in <a href="#96292">Table A-1</a>.</p>
  214:     <p>The MacCVS client works with session files, which have all
  215:     the information and settings you need to pull Mozilla. The
  216:     settings are listed on the Mac build page, which
  217:     even has a ready-made session file that you can download into
  218:     the client. Once you set your tools up and configure your
  219:     session file for MacCVS, you can pull the Mozilla source by
  220:     choosing "Check Out Default Module" from the MacCVS Action
  221:     menu. Like the Macintosh build process, pulling the source on
  222:     Macintosh involves the interaction of a series of Perl scripts.
  223:     The <i></i> script, located with the other
  224:     Macintosh build scripts in
  225:     <i>mozilla/build/mac/build_scripts</i>, can drive your MacCVS
  226:     client-starting it up and pointing to the right source, setting
  227:     the proper variables, and so on. For more information on the 
  228:     <!--INDEX ENDRANGE==Macintosh:source installation --> Macintosh
  229:     build scripts, see <i><a href=
  230:     ""></a></i>.</p>
  231:     <h3>Working with Branching</h3>
  232:     <p>Branches are <!--INDEX source code:branching --> 
  233:     <!--INDEX Mozilla:source code:branching --> distinct Mozilla
  234:     source code trees that are "cut" to carry out a specific
  235:     purpose or used for a milestone release. Developers cut
  236:     branches when making large architectural changes that could
  237:     make the main tree unstable. Branches in this context allow
  238:     freer changing and testing off the main trunk. To work with
  239:     branches, set the <i>MOZ_BRANCH</i> environment variable:</p>
  240: <pre>
  241: &gt; setenv MOZ_BRANCH=MOZILLA_1_0_BRANCH
  242: </pre>
  243:     <p>The value changes according to the repository with which you
  244:     work. All other steps can remain the same in the process.</p>
  245:     <p>To find out more about using CVS to get Mozilla source and
  246:     to learn about what else you can do with CVS, go to <i><a href=
  247:     ""></a></i>.</p>
  248:     <h2>Building the Source Code</h2>
  249:     <p>Now that you <!--INDEX source code:building --> 
  250:     <!--INDEX Mozilla:source code:building --> have the Mozilla
  251:     source code, what do you do with it? Unlike the Mozilla
  252:     binaries that are available for download, you can not start
  253:     using Mozilla once you have all the source code on your
  254:     computer. Before you can start using the source, you need to
  255:     set up your working environment and then build Mozilla.</p>
  256:     <p>For the Mozilla source to compile on your computer properly,
  257:     two main aspects of your build environment must be set up.
  258:     These aspects are the necessary tools and the proper
  259:     environment variables. You would expect such a large code base
  260:     to require a large number of tools, but there aren't so many.
  261:     <a href="#96292">Table A-1</a> lists the tools you need to
  262:     build and run the source code. All information here is
  263:     presented in more detail at <i><a href=
  264:     ""></a></i>,
  265:     including links for getting the tools.</p>
  266:     <p><i>Table A-1: <a name="96292"></a></i> <i>Platform tools
  267:     used to build the Mozilla source code</i></p>
  268:     <table width="100%" border="1">
  269:       <tr>
  270:         <td><b>Linux</b></td>
  271:         <td><b>Windows</b></td>
  272:         <td><b>Macintosh</b></td>
  273:       </tr>
  274:       <tr>
  275:         <td>egcs 1.0.3 (or higher), gcc 2.95.2</td>
  276:         <td>Microsoft Visual C++ Version 6.0 or later (with service
  277:         pack 3)</td>
  278:         <td>Code Warrior Pro 7 (including Plugin SDK)</td>
  279:       </tr>
  280:       <tr>
  281:         <td>GTK+ / Glib 1.2.0</td>
  282:         <td>Cygnus toolkit for Windows (the build page lists the
  283:         specific components)</td>
  284:         <td>Menu Sharing Toolkit 1.4</td>
  285:       </tr>
  286:       <tr>
  287:         <td>GNU make 3.74</td>
  288:         <td>Netscape Wintools (modified versions of gmake, shmsdos,
  289:         and uname)</td>
  290:         <td>ToolServer</td>
  291:       </tr>
  292:       <tr>
  293:         <td>Perl 5.005 (or higher)</td>
  294:         <td>Perl5 for Win32</td>
  295:         <td>MacPerl</td>
  296:       </tr>
  297:       <tr>
  298:         <td>cpan-mac distribution</td>
  299:       </tr>
  300:       <tr>
  301:         <td>Perl AppleEvents module</td>
  302:       </tr>
  303:       <tr>
  304:         <td>Perl Launch module</td>
  305:       </tr>
  306:       <tr>
  307:         <td>zip 2.3 (or higher)</td>
  308:         <td>Zip for Win32</td>
  309:         <td>Compress:Zlib module</td>
  310:       </tr>
  311:       <tr>
  312:         <td>Archive::Zip module</td>
  313:       </tr>
  314:       <tr>
  315:         <td>LibIDL 0.6.3 (or higher)</td>
  316:         <td>(Required for static build)</td>
  317:       </tr>
  318:       <tr>
  319:         <td>XML::RegExp</td>
  320:       </tr>
  321:       <tr>
  322:         <td>XML::Parser</td>
  323:       </tr>
  324:       <tr>
  325:         <td>XML::DOM</td>
  326:       </tr>
  327:       <tr>
  328:         <td>Autoconf 2.12 (optional)</td>
  329:       </tr>
  330:     </table>
  331:     <p>The Linux environment is usually set up by default with all
  332:     the tools listed for that platform; it therefore requires less
  333:     time to retrieve and set up programs. Linux distributions
  334:     usually come with a native compiler that is compatible with the
  335:     Mozilla build system. Most build time is used compiling the C++
  336:     source code-the language most files are written in. Therefore,
  337:     the compiler is the central component of the build system.
  338:     Linux uses egcs or gcc, Windows uses Microsoft Visual C++, and
  339:     Macintosh uses Metroworks Code Warrior. The latest version of
  340:     CVS for each platform accompanies all tools listed in <a href=
  341:     "#96292">Table A-1</a>.</p>
  342:     <p>You can set various environment settings for each platform
  343:     to configure and optimize your build environment. Most settings
  344:     are optional and some are essential. One essential is the
  345:     <i>CVSROOT</i> variable, which tells the CVS server where to
  346:     look for the tree's home or root. The next section looks at the
  347:     differences between the Unix, Windows, and Macintosh
  348:     platforms.</p>
  349:     <h3>Unix Environment</h3>
  350:     <p>Unix is <!--INDEX source code:building:Unix --> 
  351:     <!--INDEX Mozilla:source code:building in Unix --> probably the
  352:     easiest platform to configure. In fact, because it's a
  353:     developer's platform, it is designed to work with little or no
  354:     user interaction. In the source tree, script is provided to do
  355:     all the work for you. To run it, you need only the following
  356:     steps:</p>
  357: <pre>
  358: &gt; cd mozilla
  359: &gt; ./configure
  360: </pre>
  361:     <p>Running this command gathers all necessary system
  362:     information and the list of Makefiles needed to compile the
  363:     source. This command needs to be run only when a Makefile is
  364:     added or removed from the tree. After this, it is sufficient to
  365:     compile Mozilla by launching gmake with no arguments.</p>
  366:     <p>Alternatively, you can use the Unix Build Configurator, an
  367:     online tool (<i><a href=
  368:     ""></a></i>)
  369:     that lets you change certain settings if you run into any
  370:     obstacles when building. It allows setting external package
  371:     configuration, a choice of Mozilla components, and debugging
  372:     and optimization options. Once this setting is made, let
  373:     Mozilla take over via the <tt></tt> script:</p>
  374: <pre>
  375: &gt; gmake -f
  376: </pre>
  377:     <p>One useful post-build setting is the ability to run Mozilla
  378:     from any directory (rather than just dist/bin<i>)</i>. To test
  379:     this option, use MOZILLA_FIVE_HOME to point to the full path,
  380:     to the <i>dist/bin</i>, or wherever your executable
  381:     resides.</p>
  382:     <h3>Windows Environment</h3>
  383:     <p>The setup is <!--INDEX source code:building:Windows --> 
  384:     <!--INDEX Mozilla:source code:building in Windows --> different
  385:     on Windows and requires more interaction on the user's part,
  386:     mostly in setting up environment variables. <a href=
  387:     "#52766">Table A-2</a> lists these variables and expected
  388:     values. Note that some values are optional.</p>
  389:     <p><i>Table A-2: <a name="52766"></a></i> <i>Windows
  390:     environment variables used to build Mozilla</i></p>
  391:     <tt>\</tt>).<tt>OS_TARGET</tt>variable<tt>PATH</tt>variable is
  392:     an existing variable that needs the Cygwin root and binary
  393:     directories appended. The operating system looks at this
  394:     variable when looking for program executables and DLLs.
  395:     <table width="100%" border="1">
  396:       <tr>
  397:         <td><b>Variable</b></td>
  398:         <td><b>Value</b></td>
  399:         <td><b>Description</b></td>
  400:       </tr>
  401:       <tr>
  402:         <td>MOZ_BITS</td>
  403:         <td>32</td>
  404:         <td>Specifies whether you use a 16-bit or 32-bit operating
  405:         system.</td>
  406:       </tr>
  407:       <tr>
  408:         <td>MOZ_DEBUG</td>
  409:         <td>1 (optional)</td>
  410:         <td>Set only if you want a build with debug information.
  411:         Remove this variable to enable it by default.</td>
  412:       </tr>
  413:       <tr>
  414:         <td>MOZ_SRC</td>
  415:         <td>&lt;path to top of source tree&gt;</td>
  416:         <td>The directory into which you uncompress or check out
  417:         the Mozilla source. Ensure that the path does not end with
  418:         a trailing slash (</td>
  419:       </tr>
  420:       <tr>
  421:         <td>MOZ_TOOLS</td>
  422:         <td>&lt;usually the Cygwin root directory&gt;</td>
  423:         <td>The directory where gmake is installed, usually placed
  424:         there by the package (refer to <a href=
  425:         "#96292">Table A-1</a>).</td>
  426:       </tr>
  427:       <tr>
  428:         <td>WINOS</td>
  429:         <td>%OS_TARGET% (see the OS_TARGET variable)</td>
  430:         <td>An abbreviation for the operating system that is also
  431:         used internally by the OS. Windows 2000 takes a value of
  432:         WINNT. It matches the top-level directory on the filesystem
  433:         that contains all OS files.</td>
  434:       </tr>
  435:       <tr>
  436:         <td>OS_TARGET</td>
  437:         <td>WINNT (or WIN95)</td>
  438:         <td>A Mozilla representation of the</td>
  439:       </tr>
  440:       <tr>
  441:         <td>_MSC_VER</td>
  442:         <td>1200 (or 1100 for VC++ 5)</td>
  443:         <td>The version of the Microsoft Visual C++ runtime
  444:         environment running on your machine. The value of 1200 is
  445:         Version 6, the most reliable version.</td>
  446:       </tr>
  447:       <tr>
  448:         <td>DISABLE_TESTS</td>
  449:         <td>1 (Optional)</td>
  450:         <td>Set only if you do not want to build test directories
  451:         and binaries. Remove this variable to leave it enabled by
  452:         default.</td>
  453:       </tr>
  454:       <tr>
  455:         <td>MOZ_DISABLE_JAR_PACKAGING</td>
  456:         <td>1 (Optional)</td>
  457:         <td>Set only if you want to turn off compression into the
  458:         chrome structure's JAR files. Remove this variable to leave
  459:         it enabled by default.</td>
  460:       </tr>
  461:       <tr>
  462:         <td>MOZ_CONFIG</td>
  463:         <td>&lt;path to config file&gt;</td>
  464:         <td>This variable is required only for gmake builds.</td>
  465:       </tr>
  466:       <tr>
  467:         <td>PATH</td>
  468:         <td>%PATH%;%MOZ_TOOLS%\bin;c:\cygwin</td>
  469:         <td>The</td>
  470:       </tr>
  471:     </table>
  472:     <p>You can set these variables either by using the <tt>set</tt>
  473:     command for per session variables or the System &gt; Advanced
  474:     &gt; Environment Variable panel in Control Panel to set them
  475:     more permanently.</p>
  476:     <blockquote>
  477:       <div class="c2">
  478:         NOTE
  479:       </div>
  480:     </blockquote>
  481:     <blockquote>
  482:       <p>Once your environment is set and the tools are in place,
  483:       you can begin the build. Go to the <i>mozilla</i> directory
  484:       in the source code and from there, run the make script
  485:       (<i></i>) with the necessary arguments:</p>
  486:     </blockquote>
  487:     &gt;make -f build_all 
  488:     <p>Once your environment is set and the tools are in place,
  489:     building can begin. Go to the <i>mozilla</i> directory in the
  490:     source code and from there, run the make script
  491:     (<i>client.mak</i>) with the necessary arguments:</p>
  492: <pre>
  493: &gt; nmake -f client.mak build_all
  494: </pre>
  495:     <p><a href="#33735">Table A-3</a> lists these arguments and
  496:     what they do. Leaving out this compile flag starts an
  497:     incremental build or a fresh build if there is no previous
  498:     build available.</p>
  499:     <p>When building incrementally, try to use the provided make
  500:     script instead of the <tt>cvs</tt> checkout and build_all
  501:     commands. The latter command can lead to inconsistencies in
  502:     file versions and may re-download files that you do not even
  503:     need to your tree.</p>
  504:     <p><i>Table A-3: <a name="33735"></a></i> <i>Make flags</i></p>
  505:     <i>client.mak</i>.<i>nspr</i>and <i>psm</i>.
  506:     <table width="100%" border="1">
  507:       <tr>
  508:         <td><b>Flag</b></td>
  509:         <td><b>Function</b></td>
  510:       </tr>
  511:       <tr>
  512:         <td>pull_all</td>
  513:         <td>Gets only the source code.</td>
  514:       </tr>
  515:       <tr>
  516:         <td>build_all</td>
  517:         <td>Builds only the existing source code.</td>
  518:       </tr>
  519:       <tr>
  520:         <td>pull_and_build_all</td>
  521:         <td>Retrieves the source code and then builds it.</td>
  522:       </tr>
  523:       <tr>
  524:         <td>pull_and_build_all_dep</td>
  525:         <td>Does a dependent build after retrieving the source
  526:         code. The source tree is not accessed in a dependent
  527:         build.</td>
  528:       </tr>
  529:       <tr>
  530:         <td>pull_ clientmak</td>
  531:         <td>Pulls only the latest version of the build file</td>
  532:       </tr>
  533:       <tr>
  534:         <td>clobber_all</td>
  535:         <td>Deletes all files produced from a previous build to
  536:         enable a completely fresh build.</td>
  537:       </tr>
  538:       <tr>
  539:         <td>Pull_xpconnect</td>
  540:         <td>Retrieves the XPConnect module. You can retrieve other
  541:         modules this way, including</td>
  542:       </tr>
  543:     </table>
  544:     <p>To rebuild without pulling the tree, use:</p>
  545: <pre>
  546: &gt; make -f build_all_depend
  547: </pre>
  548:     <p>To get or update the source code and not build, use:</p>
  549: <pre>
  550: &gt; make -f checkout
  551: </pre>
  552:     <h3>Macintosh Environment</h3>
  553:     <p>In terms of <!--INDEX source code:building:Macintosh OS --> 
  554:     <!--INDEX Mozilla:source code:building in Macintosh OS -->
  555:     environment setup, necessary resources, and actual compile
  556:     time, the Mac OS is the least straightforward of the three
  557:     major platforms Mozilla builds on. There are several different
  558:     kinds of Mac builds at, but this section focuses on
  559:     just two: the Classic Mac OS 9's standard build, which has been
  560:     the default for a long time, and Mac OS X's Code Fragment
  561:     Manager (CFM).</p>
  562:     <p>Mac OS X builds are becoming more popular as the platform is
  563:     adopted more widely. Better performance and native Unix build
  564:     system tools have boosted developer support for Mozilla on Mac
  565:     OS X. However, the Macintosh is by far the most resource hungry
  566:     of all platforms Mozilla builds on. The minimum specification
  567:     includes 1 GB of disk space and 128 MB of memory, but you will
  568:     probably need even more in reality.</p>
  569:     <p>To compile the source, check out the module
  570:     <i>mozilla/build/mac/build_scripts</i>. Once the download is
  571:     complete, go to the folder and run <i></i> for
  572:     an optimized build or <i></i> for a debug
  573:     build. Running the CodeWarrior environment during or before
  574:     running build scripts is useful. When you run the build script,
  575:     you will be asked for the location of CodeWarrior, if it is not
  576:     already running. You can change some build options through a
  577:     local preferences file, which can be found in the system
  578:     preferences folder for system variables or at the root of the
  579:     Mozilla tree for tree-specific variables. You can find more
  580:     information on fine-tuning the build at <i><a href=
  581:     ""></a></i>.</p>
  582:     <p>When the compile is complete, you need to take an extra step
  583:     to start it. Mozilla needs certain things set properly so it
  584:     can gather the information it needs at runtime. Traditional Mac
  585:     OS systems have no concept of environment variables per se, but
  586:     one alternative is to use a startup file called <i>NSPR
  587:     Logging</i> that comes with Mozilla in the same directory as
  588:     the application. Its lines are in the following format:</p>
  589: <pre>
  590: ENV:NSPR_LOG_MODULES=nsComponentManager:5
  591: ENV:NSPR_LOG_FILE=xpcom.log
  592: </pre>
  593:     <p>Dragging this file onto Mozilla starts the application with
  594:     those settings. You can edit this file by adding or changing
  595:     the <tt>ENV</tt> lines or make another file. This modification
  596:     method is useful for single session settings. For more
  597:     permanent settings, you can create a file called
  598:     <i>ENVIRONMENT</i> and put it in the same folder as Mozilla.
  599:     Mozilla picks up the environment variables in the
  600:     <i>ENVIRONMENT</i> file when it runs. The file contents look
  601:     something like:</p>
  602: <pre>
  603: NSPR_LOG_MODULES=nsComponentManager:5
  604: NSPR_LOG_FILE=xpcom.log
  605: </pre>
  606:     <p>The Mac OS X CFM version uses the same build system as OS 9.
  607:     If you build, you need to adjust the following setting in order
  608:     to build with Carbon, which is a set of APIs that transition
  609:     developers from OS9 and earlier releases to the new OS X system
  610:     architecture:</p>
  611:     <p>In your <i>Prefs</i> folder, add the following line to the
  612:     Mozilla[debug/opt] build prefs file:</p>
  613: <pre>
  614: options carbon 1
  615: </pre>
  616:     <p>For more information on pulling the Mozilla source on OS X,
  617:     the OS X build process, and other OSX Mozilla resources, see
  618:     <i><a href=
  619:     ""></a>.</i></p>
  620:     <!-- <hr> -->
  621:     <?php $hide_text_control=1; $post_to_list=NO; $author=''; // require(NOTES); ?>

FreeBSD-CVSweb <>