CloudServices/Sync/FxSync/Archived/Building:Older Versions

From MozillaWiki
Jump to: navigation, search

Back to Labs/Weave.

General Building


Before you can build Weave, you'll need a few tools:

1. A C compiler.

2. If you're on Windows, you'll need mingw. Alternatively a pre-configured package containing mingw and other useful tools is called MozillaBuild

3. If you want to commit changes to Weave's source code, you'll need a Mercurial client, available here.

4. The Gecko SDK, available here. You might need the latest build, available here 1.9.1 latest-trunk

Retrieving the Source

Retrieve the Weave source code from the Mozilla Mercurial source repository using the following command:

 hg clone

Alternatively, you can also retrieve the latest tarball of the source from:

You can also retrieve the latest zip of the source from:


1. Set the MOZSDKDIR environment variable to the location of your Gecko SDK. (Note: the "dist" directory within a Firefox build's objdir is one good option for this.) e.g.:

 export MOZSDKDIR=/path/to/gecko/sdk

2. Run the make command in the root directory of the Weave checkout, e.g.:


This should build Weave and run its unit tests.

Buidling Weave 0.2x on Ubuntu

1. Open a terminal.

2. Download required build environment:

 sudo apt-get install xulrunner-1.9-dev mercurial build-essential

3. Check out a copy of weave:

 hg clone weave

3.5 For Ubuntu 8.04 / 64-bit

 sudo ln -s /usr/include/nspr /usr/lib/xulrunner-devel-
 sudo ln -s /usr/include/nss /usr/lib/xulrunner-devel-


 cd weave
 make sdkdir=/usr/lib/xulrunner-devel- xpi

5. Install:

 firefox-3.0 weave-Linux.xpi

(Instructions derived from thread: Mozilla weave 2.5 on 64-bit / Ubuntu 8.04)

(this instructions are not working on Ubuntu 64bit and latest weave)

Building Weave 0.20 on Windows

1. You'll need a copy of Microsoft Visual Studio

2. Follow the MozillaBuild instructions

3. Make sure you have the Gecko SDK and the Weave source you want to compile unpacked in the same directory (just to make life easier)

4. Create a shell script to set the required environment variables and build. I called mine "" and it looks something like this:

 export WEAVE_BUILDID=649c1d8b5d43
 export MOZSDKDIR=$mingwroot/xulrunner-sdk
 export TOPSRCDIR=$mingwroot/weave-$WEAVE_BUILDID
 export NATIVE_TOPSRCDIR=$winroot\\weave-$WEAVE_BUILDID

5. Run your script from within your MozillaBuild command window


Building Weave 0.20 on MacOSX for PPC

Note: The easiest way is to build is to get 10.5 and the latest XCode for it. 10.4's XCode's ld does not accept the -exported_symbol argument (without modification of the makefile). Read the [Note]


1. Xcode (included on the 10.5 Leopard DVD, or can be downloaded from Apple Developer Connection).

2. Mercurial so you can generate a buildid.

3. MacPorts You need to get libidl and glib1 from it.

4. XUL-runner from the source because xpidl is not included with the SDK binaries (at least for PPC).

Setup and Configuration of the Prerequisites

1. Mercurial: make local && ./hg version (or install via MacPorts with sudo port install mercurial or via Fink with fink install mercurial-py25)

2. MacPorts:

a. Install MacPorts
b. sudo port install glib1 libidl

3. XUL-runner:

./configure --with-glib-prefix=/opt/local --with-libIDL-prefix=/opt/local --enable-application=browser
make -C config
make -C nsprpub
make -C xpcom/typelib

Adding variables to .profile

1. Open Terminal application

2. use vi/vim or your favourite editor open .profile in your directory

3. Add these variables to your .profile

export MOZSDKDIR=/opt/local/mozilla/ #from section 3 above
export TOPSRCDIR=<path to weave's source>
export NATIVE_TOPSRCDIR=<path to weave's source>
export PATH=$PATH:/usr/local/bin:<path to MOZSDKDIR's BIN directory>

4. Restart your terminal(s).

Getting the source, modification and build (extra change for 0.20)

The source for Weave is here

For 0.20 you need to make just one modification in src/Makefile Line 79 change the line to:

 ifeq ($(machine), Power Macintosh) 

Remember to save!

then run make in the weave directory. Compilation should proceed correctly and the add on will be built.


1. A thread where I have been helping Slothrop etc to compile for their PPC.

2. A good starting point to get XPIDL working.

10.4 Note

Weave will not compile out of the box on 10.4.

Also 10.4 doesn't come with Python, which Mercurial needs.

The alternatives 1. Upgrade / change the gcc via macports. 10.4 uses gcc 4.0.1. You can search for later versions via macports search gcc command. Do not forget you need new binutils too. Remember to also get and run gcc_select so you can change the default version (back and forth).

Also before you build, make sure you run the apps eg cc or ld with the -v flag, so you are clear about the app version you are running.

or 2. Upgrade to 10.5

Good luck!