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

Back to Labs/Weave.

General Building

Prerequisites

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

1. A C compiler.

2. If you're on Windows, you'll need cygwin.

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.

Retrieving the Source

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

 hg clone http://hg.mozilla.org/labs/weave

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

 http://hg.mozilla.org/labs/weave/index.cgi/archive/tip.tar.gz

Building

1. Set the MOZSDKDIR environment variable to the location of your Gecko SDK, e.g.:

 export MOZSDKDIR=/path/to/gecko/sdk

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

 make

This should build Weave and run its unit tests.

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).

Prerequisites (besides the obvious like XCode)

1. Mercurial (so you can generate a buildid)

2. Macports

3. XUL-runner (from source because xpidl doesn't seem to come with the SDK binaries at least for PPC)

Setup and Configuration of the Prerequisites

1. Mercurial: make local && ./hg version

2. Macports:

a. install macports (you will need to sudo)
b. port install libidl
c. port install glib1

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 for 0.20, modification and build

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) 

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

References

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.. so the alternatives is to upgrade / change the gcc via macports. 10.4 uses 4.0.1. You can search for later versions via macports search gcc command. However remember to also get and run gcc_select so you can change the default version.

Also 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.

Good luck!