CloudServices/Sync/FxSync/Archived/Building:Older Versions: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
(28 intermediate revisions by 11 users not shown)
Line 9: Line 9:
1. A C compiler.
1. A C compiler.


2. If you're on Windows, you'll need [http://www.cygwin.com/ cygwin].
2. If you're on Windows, you'll need [http://www.mingw.org/ mingw]. Alternatively a pre-configured package containing mingw and other useful tools is called [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#MozillaBuild MozillaBuild]


3. If you want to commit changes to Weave's source code, you'll need a Mercurial client, available [http://www.selenic.com/mercurial/wiki here].
3. If you want to commit changes to Weave's source code, you'll need a Mercurial client, available [http://www.selenic.com/mercurial/wiki here].


4. The Gecko SDK, available [http://developer.mozilla.org/en/docs/Gecko_SDK here].
4. The Gecko SDK, available [http://developer.mozilla.org/en/docs/Gecko_SDK here]. You might need the latest build, available here [http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-mozilla-1.9.1/ 1.9.1 latest-trunk]


=== Retrieving the Source ===
=== Retrieving the Source ===
Line 24: Line 24:


   http://hg.mozilla.org/labs/weave/index.cgi/archive/tip.tar.gz
   http://hg.mozilla.org/labs/weave/index.cgi/archive/tip.tar.gz
You can also retrieve the latest zip of the source from:
  http://hg.mozilla.org/labs/weave/index.cgi/archive/tip.zip


=== Building ===
=== Building ===


1. Set the <code>MOZSDKDIR</code> environment variable to the location of your Gecko SDK, e.g.:
1. Set the <code>MOZSDKDIR</code> 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
   export MOZSDKDIR=/path/to/gecko/sdk
Line 36: Line 40:


This should build Weave and run its unit tests.
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 http://hg.mozilla.org/labs/weave weave
3.5 For Ubuntu 8.04 / 64-bit
  sudo ln -s /usr/include/nspr /usr/lib/xulrunner-devel-1.9.0.6/include/
  sudo ln -s /usr/include/nss /usr/lib/xulrunner-devel-1.9.0.6/include/
4.Build!
  cd weave
  make sdkdir=/usr/lib/xulrunner-devel-1.9.0.6 xpi
5. Install:
  firefox-3.0 weave-Linux.xpi
(Instructions derived from thread: [http://ubuntuforums.org/showthread.php?t=873360 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 [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#MozillaBuild 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 "makeweave.sh" and it looks something like this:
  # EDIT THE BUILDID AND PATHS
  export WEAVE_BUILDID=649c1d8b5d43
  mingwroot=c:/weavebuild
  winroot=c:\\weavebuild
 
  export MOZSDKDIR=$mingwroot/xulrunner-sdk
  export TOPSRCDIR=$mingwroot/weave-$WEAVE_BUILDID
  export NATIVE_TOPSRCDIR=$winroot\\weave-$WEAVE_BUILDID
 
  cd $TOPSRCDIR
 
  make
5. Run your script from within your MozillaBuild command window
  ./makeweave.sh


== Building Weave 0.20 on MacOSX for PPC==
== 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).
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 [[http://wiki.mozilla.org/Labs/Weave/Building#10.4_Note Note]]


=== Prerequisites (besides the obvious like XCode)===
=== Prerequisites ===
1. [http://developer.mozilla.org/en/docs/Mercurial Mercurial] (so you can generate a buildid)
1. Xcode (included on the 10.5 Leopard DVD, or can be downloaded from [http://developer.apple.com/ Apple Developer Connection]).


2. [http://www.macports.org/ Macports]
2. [http://developer.mozilla.org/en/docs/Mercurial Mercurial] so you can generate a buildid.


3. [http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.0/source/ XUL-runner] (from source because ''xpidl'' doesn't seem to come with the SDK binaries at least for PPC)
3. [http://www.macports.org/ MacPorts] You need to get libidl and glib1 from it.
 
4. [http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.0/source/ XUL-runner] from the source because ''xpidl'' is not included with the SDK binaries (at least for PPC).


=== Setup and Configuration of the Prerequisites===
=== Setup and Configuration of the Prerequisites===
1. Mercurial: ''make local && ./hg version''
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:  
2. MacPorts:  
  a. install macports (you will need to sudo)
  a. Install MacPorts
  b. ''port install libidl''
  b. ''sudo port install glib1 libidl''
c. ''port install glib1''


3. XUL-runner:
3. XUL-runner:
Line 65: Line 119:
1. Open Terminal application
1. Open Terminal application


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


3. Add these variables to your profile
3. Add these variables to your .profile
  ''export MOZSDKDIR=/opt/local/mozilla/" #from section 3 above
  ''export MOZSDKDIR=/opt/local/mozilla/ #from section 3 above
  ''export TOPSRCDIR=<path to weave's source>''
  ''export TOPSRCDIR=<path to weave's source>''
  ''export NATIVE_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>:''
  ''export PATH=$PATH:/usr/local/bin:<path to MOZSDKDIR's BIN directory>''


4. Restart your terminals.
4. Restart your terminal(s).


===Getting the source for 0.20, modification and build===
===Getting the source, modification and build (extra change for 0.20)===
The source for Weave is [http://hg.mozilla.org/labs/weave/?archive/tip.tar.gz here]
The source for Weave is [http://hg.mozilla.org/labs/weave/?archive/tip.tar.gz here]


Line 82: Line 136:
   ''ifeq ($(machine), Power Macintosh)''  
   ''ifeq ($(machine), Power Macintosh)''  


then run make in the weave directory should proceed correctly and the add on will be built.
Remember to save!
 
then run ''make'' in the weave directory. Compilation should proceed correctly and the add on will be built.


===References===   
===References===   
1.[https://labs.mozilla.com/forum/index.php/topic,965.0.html A thread where I have been helping Slothrop etc to compile for their PPC.]
1. [https://labs.mozilla.com/forum/index.php/topic,965.0.html A thread where I have been helping Slothrop etc to compile for their PPC.]


2.[http://orangevu.com/gebitu/weblog/7.htmll A good starting point to get XPIDL working.]
2. [http://orangevu.com/gebitu/weblog/7.html A good starting point to get XPIDL working.]


===10.4 Note===
===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 [http://www.macports.org/ports.php?by=name&substr=gcc_select gcc_select] so you can change the default version.
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 [http://www.macports.org/ports.php?by=name&substr=gcc_select 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.


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.
or 2. Upgrade to 10.5


Good luck!
Good luck!

Latest revision as of 20:11, 19 November 2013

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

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

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

Building

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

 make

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 http://hg.mozilla.org/labs/weave weave

3.5 For Ubuntu 8.04 / 64-bit

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

4.Build!

 cd weave
 make sdkdir=/usr/lib/xulrunner-devel-1.9.0.6 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 "makeweave.sh" and it looks something like this:

 # EDIT THE BUILDID AND PATHS
 export WEAVE_BUILDID=649c1d8b5d43
 mingwroot=c:/weavebuild
 winroot=c:\\weavebuild
 
 export MOZSDKDIR=$mingwroot/xulrunner-sdk
 export TOPSRCDIR=$mingwroot/weave-$WEAVE_BUILDID
 export NATIVE_TOPSRCDIR=$winroot\\weave-$WEAVE_BUILDID
 
 cd $TOPSRCDIR
 
 make

5. Run your script from within your MozillaBuild command window

 ./makeweave.sh

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]

Prerequisites

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.

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 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!