Adding Files to the Build

  • Revision slug: Adding_Files_to_the_Build
  • Revision title: Adding Files to the Build
  • Revision id: 48882
  • Created:
  • Creator: Hsivonen
  • Is current revision? No
  • Comment 30 words added

Revision Content

 

So you want to add something (and not break the build) ...

All platforms are now using the same set of Makefiles for the build, so, finally, all you have to do are edit Makefile.in files (and possibly mozilla/allmakefiles.sh if you add new makefiles and possibly toolkit/toolkit-tiers.mk).

{{ Note("Don\'t forget to check Tinderbox after you check in!") }}

 

Adding files to the build

  • All platforms use Makefile.in files now. Edit these to add new source files, and export header files.
  • Dependencies are specified in Makefile.in too
  • If you add a new directory to the build, you have to add an entry for its Makefile in the directory list in mozilla/allmakefiles.sh, as well as adding the directory to the list of subdirs in ../Makefile.in.
  • Some directories are special, and you need to list new directories in toolkit/toolkit-tiers.mk.
  • On platforms that build with gcc, because of the symbol visibility, you might have to check System Headers to make sure they are properly wrapped.

Checking In

Adding new files to the build can cause breakage on tinderbox and to other developers if things aren't checked in the correct order.

  1. Check in only the new files.
  2. Check in the patches to existing files that make your new files get used.

Exporting Files

Exporting a file makes it get copied to mozilla/dist. C and C++ header files are exported by including them the EXPORTS list in {{ Source("xpcom/base/Makefile.in#60", "Makefile.in") }}, and IDL files are exported by including them in the XPIDLSRCS list.

XPInstall

If you create something that needs to be present in an end-user distribution then don't forget to add it to the proper xpinstall packages. Add your file to the appropriate places (depending on where it's needed) in mozilla/xpinstall/packager/packages-win or mozilla/xpinstall/packager/xpcom-win.pkg (GRE), mozilla/xpinstall/packager/packages-static-win, mozilla/xpinstall/packager/packages-unix, mozilla/xpinstall/packager/packages-static-unix, and mozilla/xpinstall/packager/packages-os2. If your new files are needed by embedders, then also add them to the appropriate lists in mozilla/embedding/config/basebrowser-*.

Neglecting to add your new files to xpinstall packages means that your new feature will work when you run it from your own tree, but will break in packages distributed to actual end users.

Original Document Information

  • Author(s): Akkana Peck
  • Last Updated Date: May 28, 2007
  • Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.

{{ languages( { "ja": "ja/Adding_Files_to_the_Build" } ) }}

Revision Source

<p> </p>
<p><strong>So you want to add something (and not break the build) ...</strong></p>
<p>All platforms are now using the same set of Makefiles for the build, so, finally, all you have to do are edit Makefile.in files (and possibly <code class="filename">mozilla/allmakefiles.sh</code> if you add new makefiles and possibly <code>toolkit/toolkit-tiers.mk</code>).</p>
<p>{{ Note("Don\'t forget to check Tinderbox after you check in!") }}</p>
<p> </p>
<h3 name="Adding_files_to_the_build">Adding files to the build</h3>
<ul> <li>All platforms use <code class="filename">Makefile.in</code> files now. Edit these to add new source files, and export header files.</li> <li>Dependencies are specified in <code class="filename">Makefile.in</code> too</li> <li>If you add a new directory to the build, you have to add an entry for its Makefile in the directory list in <code class="filename">mozilla/allmakefiles.sh</code>, as well as adding the directory to the list of subdirs in <code class="filename">../Makefile.in</code>.</li> <li>Some directories are special, and you need to list new directories in <code>toolkit/toolkit-tiers.mk</code>.</li> <li>On platforms that build with gcc, because of the symbol visibility, you might have to check <a href="/en/System_Headers" title="en/System_Headers">System Headers</a> to make sure they are properly wrapped.</li>
</ul>
<h3 name="Checking_In">Checking In</h3>
<p>Adding new files to the build can cause breakage on tinderbox and to other developers if things aren't checked in the correct order.</p>
<ol> <li>Check in only the new files.</li> <li>Check in the patches to existing files that make your new files get used.</li>
</ol>
<h3 name="Exporting_Files">Exporting Files</h3>
<p>Exporting a file makes it get copied to mozilla/dist. C and C++ header files are exported by including them the <code>EXPORTS</code> list in <code class="filename">{{ Source("xpcom/base/Makefile.in#60", "Makefile.in") }}</code>, and IDL files are exported by including them in the <code>XPIDLSRCS</code> list.</p>
<h3 name="XPInstall">XPInstall</h3>
<p>If you create something that needs to be present in an end-user distribution then don't forget to add it to the proper xpinstall packages. Add your file to the appropriate places (depending on where it's needed) in <code class="filename">mozilla/xpinstall/packager/packages-win</code> or <code class="filename">mozilla/xpinstall/packager/xpcom-win.pkg</code> (GRE), <code class="filename">mozilla/xpinstall/packager/packages-static-win</code>, <code class="filename">mozilla/xpinstall/packager/packages-unix</code>, <code class="filename">mozilla/xpinstall/packager/packages-static-unix</code>, and <code class="filename">mozilla/xpinstall/packager/packages-os2</code>. If your new files are needed by embedders, then also add them to the appropriate lists in <code class="filename">mozilla/embedding/config/basebrowser-*</code>.</p>
<p>Neglecting to add your new files to xpinstall packages means that your new feature will work when you run it from your own tree, but will break in packages distributed to actual end users.</p>
<div class="originaldocinfo">
<h2 name="Original_Document_Information">Original Document Information</h2>
<ul> <li>Author(s): <a class="link-mailto" href="mailto:akkana@netscape.com">Akkana Peck</a></li> <li>Last Updated Date: May 28, 2007</li> <li>Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | <a class="external" href="http://www.mozilla.org/foundation/licensing/website-content.html">Details</a>.</li>
</ul>
</div>

<p>{{ languages( { "ja": "ja/Adding_Files_to_the_Build" } ) }}</p>
Revert to this revision