Gecko SDK

  • Revision slug: Gecko_SDK
  • Revision title: Gecko SDK
  • Revision id: 30643
  • Created:
  • Creator: Andreas Wuest
  • Is current revision? No
  • Comment Moved the note on updating the SDK right under the 'Get the SDK' section title

Revision Content

Overview

The Gecko SDK is a set of XPIDL files, headers and tools to develop XPCOM components which can then in turn e.g. be accessed from XUL using JavaScript.

Note that in order to develop such components, you do not need the full sources of e.g. Firefox, since you do not access parts of the front end from within a component. Furthermore, since a component contains basic functionality, it is intended to run with every product of the Mozilla platform. Therefore it makes no sense to use a particular product to build general functionality. That's the reason why the Gecko SDK was devised.

Do not confuse the Gecko SDK with XULRunner. The Gecko SDK is a collection of header files and tools used to develop general XPCOM components which add functionality to the existing platform, whereas XULRunner is a runtime to bootstrap stand-alone applications based on the Mozilla framework.

Get the SDK

NOTE that there is no need to download or rebuild the Gecko SDK corresponding to security updates of Mozilla (i.e., Mozilla 1.7.3) since the Gecko SDK is not changed as a result of security updates.

Downloading

When downloading the Gecko SDK, it is important to choose the version that corresponds to the earliest version of Mozilla that you wish to target. In other words, you shouldn't download the 1.7 Gecko SDK if you want to use your component with Mozilla 1.6. This is important because binary compatibility is ensured only with future versions of the Gecko runtime. For this tutorial, we'll be using the 1.7 version of the Gecko SDK so that our component is binary compatible with Mozilla 1.7 (and any derived products such as Firefox 1.0 or Netscape 7.2).

NOTE: The Gecko SDK changed significantly between Mozilla 1.6 and 1.7, including string API changes that result in smaller components since there is no longer any need to link to the embedstring static library.

Download the 1.7 Gecko SDK from here.

The Gecko SDK is not officially supported for other platforms, though for some other platforms it may be available under the contrib subdirectory.

Unpack the SDK tarball to some suitable location.

Building from Source

Getting the Source

Either download the Mozilla source code or get it from CVS directly. The project (<tt>MOZ_CO_PROJECT</tt>) you want to check out is <tt>xulrunner</tt> (the Gecko SDK is an integral part of XULRunner):

make -f client.mk checkout MOZ_CO_PROJECT=xulrunner

Building the Gecko SDK

Build XULRunner with:

make -f client.mk build

The Gecko SDK is output under dist/sdk in your object dir. You can now copy this directory to wherever you want and remove the XULRunner tree (or keep it, if you plan to get future revisions of the Gecko SDK).

Please see Mozilla Source Code Via CVS for more information on how to check out specific branches. Also, see Configuring Build Options to specify an object dir.

Contents of the SDK

The SDK contains the following:

  • IDL files for frozen interfaces (under idl/)
  • Header files for frozen interfaces, XPCOM functions, and NSPR functions (under include/)
  • Import libraries or shared libraries (under lib/)
  • Static utility libraries (under lib/)
  • Various tools (under bin/)

Revision Source

<p>
</p>
<h2 name="Overview">Overview</h2>
<p>The Gecko SDK is a set of <a href="en/XPIDL">XPIDL</a> files, headers and tools to develop <a href="en/XPCOM">XPCOM</a> components which can then in turn e.g. be accessed from <a href="en/XUL">XUL</a> using <a href="en/JavaScript">JavaScript</a>.
</p><p>Note that in order to develop such components, you do not need the full sources of e.g. Firefox, since you do not access parts of the front end from within a component. Furthermore, since a component contains basic functionality, it is intended to run with every product of the Mozilla platform. Therefore it makes no sense to use a particular product to build general functionality. That's the reason why the Gecko SDK was devised.
</p><p>Do not confuse the Gecko SDK with <a href="en/XULRunner">XULRunner</a>. The Gecko SDK is a collection of header files and tools used to develop general XPCOM components which add functionality to the existing platform, whereas XULRunner is a  runtime to bootstrap stand-alone applications based on the Mozilla framework.
</p>
<h2 name="Get_the_SDK">Get the SDK</h2>
<p><b>NOTE</b> that there is no need to download or rebuild the Gecko SDK corresponding to security updates of Mozilla (i.e., Mozilla 1.7.3) since the Gecko SDK is not changed as a result of security updates.
</p>
<h3 name="Downloading">Downloading</h3>
<p>When downloading the Gecko SDK, it is important to choose the version that
corresponds to the earliest version of Mozilla that you wish to
target.  In other words, you shouldn't download the 1.7 Gecko SDK if you want
to use your component with Mozilla 1.6.  This is important because binary
compatibility is ensured only with future versions of the Gecko runtime.  For
this tutorial, we'll be using the 1.7 version of the Gecko SDK so that our
component is binary compatible with Mozilla 1.7 (and any derived products
such as Firefox 1.0 or Netscape 7.2).
</p><p><b>NOTE:</b> The Gecko SDK changed significantly between Mozilla 1.6 and 1.7,
including string API changes that result in smaller components since there is
no longer any need to link to the <code>embedstring</code> static library.
</p><p>Download the 1.7 Gecko SDK from
<a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest-1.7/">here</a>.
</p>
<ul><li> <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest-1.7/gecko-sdk-i686-pc-linux-gnu.tar.gz">gecko-sdk-i686-pc-linux-gnu.tar.gz</a> for development under Linux (x86 architecture)
</li><li> <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest-1.7/gecko-sdk-i586-pc-msvc.zip">gecko-sdk-i586-pc-msvc.zip</a> for development under Windows
</li></ul>
<p>The Gecko SDK is not officially supported for other platforms, though for some other
platforms it may be available under the
<a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7/contrib/">contrib</a>
subdirectory. 
</p><p>Unpack the SDK tarball to some suitable location.
</p>
<h3 name="Building_from_Source">Building from Source</h3>
<h4 name="Getting_the_Source">Getting the Source</h4>
<p>Either <a href="en/Download_Mozilla_Source_Code">download the Mozilla source code</a> or <a href="en/Mozilla_Source_Code_Via_CVS">get it from CVS</a> directly. The project (<tt>MOZ_CO_PROJECT</tt>) you want to check out is <tt>xulrunner</tt> (the Gecko SDK is an integral part of <a href="en/XULRunner">XULRunner</a>):
</p>
<pre class="eval">make -f client.mk checkout MOZ_CO_PROJECT=xulrunner
</pre>
<h4 name="Building_the_Gecko_SDK">Building the Gecko SDK</h4>
<p>Build XULRunner with:
</p>
<pre class="eval">make -f client.mk build
</pre>
<p>The Gecko SDK is output under <code>dist/sdk</code> in your object dir. You can now copy this directory to wherever you want and remove the XULRunner tree (or keep it, if you plan to get future revisions of the Gecko SDK).
</p><p><b>Please</b> see <a href="en/Mozilla_Source_Code_Via_CVS">Mozilla Source Code Via CVS</a> for more information on how to check out specific branches. Also, see <a href="en/Configuring_Build_Options">Configuring Build Options</a> to specify an object dir.
</p>
<h2 name="Contents_of_the_SDK">Contents of the SDK</h2>
<p>The SDK contains the following:
</p>
<ul><li> IDL files for frozen interfaces (under <code>idl/</code>)
</li><li> Header files for frozen interfaces, XPCOM functions, and NSPR functions (under <code>include/</code>)
</li><li> Import libraries or shared libraries (under <code>lib/</code>)
</li><li> Static utility libraries (under <code>lib/</code>)
</li><li> Various tools (under <code>bin/</code>)
</li></ul>
Revert to this revision