User:Jamesboston

From CDOT Wiki
Revision as of 07:55, 12 September 2008 by Jamesboston (talk | contribs) (Added note about Mercurial. Changed irc nick.)
Jump to: navigation, search

Profile

James Boston is working on the Mozilla Developer Resource Kit.

Blog & homepage:
jamesboston.ca

Contact:
Email james at the domain that has my name or look for me on irc:
jboston on irc://irc.mozilla.org/seneca


Building Firefox

Note: These instructions are good for Firefox 3.0.*. However, for Firefox 3.1.*, cvs has been replaced with Mercurial. These notes are not yet updated to reflect this.

Building on Windows Vista

Install Visual Studio: (The express version will work.)

http://msdn2.microsoft.com/en-us/vstudio/aa700736.aspx

Get Microsoft Windows Software Development Kit Update for Windows Vista:

http://www.microsoft.com/downloads/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065&DisplayLang=en 

Download and install Mozilla Build, a package of software prereqs: (If you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. After that all should be well.)

http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.2.exe

Open a shell window by right clicking and using admin privileges: (The example here is for Visual Studio 2005. The name of the bat file you use should match the directory that Visual Studio is installed in.)

c:\mozilla-build\start-msvc8.bat

Get the makefile instructions to pull the source tree and put it in a directory called mozilla in your home directory: (This will create a mozilla directory in your root i.e C:\Users\YourName or whatever. If a directory called mozilla already exits, even if it's empty, it will cause an error.)

cd
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk

Checkout the source:

cd ~/mozilla
make -f client.mk checkout MOZ_CO_PROJECT=browser

Create and open a hidden file called .mozconfig in your home directory:

notepad.exe ~/.mozconfig

Add the following lines to .mozconfig

# My first mozilla config
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --disable-static --enable-shared

Visual Studio 2008 users may also need to add the following to .mozconfig

ac_add_options --disable-xpconnect-idispatch
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --disable-accessibility

Start the build (which will take AT LEAST one hour):

cd ~/mozilla
make -f client.mk build

Once the build is finished you should set the following environment variable to turn-off assertion dialogs:

export XPCOM_DEBUG_BREAK=warn

When you run Firefox for the first time, create and select a new profile called "development" (or any name of your choice) to avoid corrupting your current profile. You can do this while running your current version of Firefox using these command line options:

~/mozilla/obj*/dist/bin/firefox -Profilemanager -no-remote

The finished build can be found in the ~/mozilla/obj*/dist/bin directory.

Run the file "mozilla" or "firefox", not the binary "mozilla-bin" or "firefox-bin".

For more detailed info about the windows build requirements visit Mozilla Developer Center.

For more detailed information about Mozilla building visit Real World Mozilla Build Lab.

For more info about Visual Studio 2008 problems see Lukas Blakk's blog.

Building on Windows XP

The instructions are the same as for Windows Vista. For Firefox 3, the Vista SDK is also required. However, try adding the following additional line to your .mozconfig file first:

ac_add_options --disable-vista-sdk-requirements

Another problem is that you may not be able to use your home directory because the path may have spaces. If that is the case, just put the mozilla directory in your root (ie. C:\mozilla) and put the .mozconfig file in that directory.

Building on Ubuntu and Fedora

Install build pre-requisites for Fedora users:

su -c "yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'"

Install build pre-requisites for Ubuntu users:

sudo apt-get install build-essential
sudo apt-get build-dep mozilla-firefox

Get the makefile instructions to pull the source tree and put it in a directory called mozilla in your home directory:

cd
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk

Checkout the source:

cd ~/mozilla
make -f client.mk checkout MOZ_CO_PROJECT=browser

Create and open a hidden file called .mozconfig in your home directory:

gedit ~/.mozconfig

Add the following lines to .mozconfig

# My first mozilla config
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --disable-static --enable-shared

Start the build (which will take AT LEAST one hour):

cd ~/mozilla
make -f client.mk build

Once the build is finished you should set the following environment variable to turn-off assertion dialogs:

export XPCOM_DEBUG_BREAK=warn

When you run Firefox for the first time, create and select a new profile called "development" (or any name of your choice) to avoid corrupting your current profile. You can do this while running your current version of Firefox using these command line options:

~/mozilla/obj*/dist/bin/firefox -Profilemanager -no-remote

The finished build can be found in the ~/mozilla/obj*/dist/bin directory.

Run the file "mozilla" or "firefox", not the binary "mozilla-bin" or "firefox-bin".

For more detailed information visit Real World Mozilla Build Lab.

Building on OS X

Build pre-requisites and instructions for OS X can be found at the Mozilla Developer Center.

Although the instructions are good, it may be necessary to take a few extra steps. For instance, the build may have trouble finding the glib dependency. If this happens, try adding this to your path:

export PATH=$PATH:/sw/bin;/sw/sbin

If you have built Firefox in your home directory and are trying to start it from the command line try these steps:

cd ~/mozilla/dist/Minefield.app/Contents/MacOS
./firefox -Profilemanager -no-remote

Software

SHTTPD Extension

This is a proof of concept. Installing this extension will start a tiny webserver that runs locally. The purpose of this is to eventually provide a way to distribute web application as extensions so they can be run locally/offline. At present, when the browser starts the server also starts and installs an icon to the system tray. It only runs on Win32 machines.

Download: http://jamesboston.ca/extensions/shttpd.xpi

(The server is licensed as beerware and is available on its own at http://shttpd.sourceforge.net/).

Open in Editor Extension

This extension will open source code files from http://mxr.mozilla.org in an editor on the users machine. Simply right click on the loaded page and select the Open in Editor option from the pop up context menu. The user may choose any editor through preference settings. If no preferences are selected the extension defaults to gedit on Linux, notepad on Windows, and (currently) nothing on OS X.

Download: http://zenit.senecac.on.ca/wiki/imgs/Openineditor.xpi