Changes

Jump to: navigation, search

User:Jamesboston

1,423 bytes removed, 07:04, 17 April 2009
Building Firefox
= Building Firefox =
== Building on Install prerequisites == === Windows Vista or XP ===
Install Visual Studio:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe
Open To open a shell window click (on Vista right -click and using for admin privilegeson Vista): c:\mozilla-build\start-msvc8.bat (The example above is for Visual Studio 2005. The name of the bat file you use should match the directory that Visual Studio is installed in.=== Linux === Install build pre-requisites for Fedora 10 users: su -c "yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'" su -c "yum install mercurial autoconf213 libXt-devel"
''(The example here is Install Firefox 3 build re-requisites for Visual Studio 2005Ubuntu 8. The name of 10 users: sudo apt-get install build-essential sudo apt-get build-dep firefox sudo apt-get install mercurial libasound2 libasound2-dev curl libcurl4-gnutls-dev You may need to set an environment variable if the bat file build system can't find autoconf: export AUTOCONF=autoconf2.13  === OS X === In order to build Firefox you use should match the directory that Visual Studio is installed in.)''will need something called MacPorts which can be dowloaded from here: chttp:\mozilla//www.macports.org/install.php After downloading and installing MacPorts you can then install the pre-build\start-msvc8.batrequisites: sudo port sync sudo port install mercurial libidl autoconf213
If you are attempting to build Firefox 3.1 you can checkout the source using mercurial as described below. When creating a working directory and checking out the source it doesn't really matter where you put it, but avoid paths that contain spaces. If your user name doesn't have space you can checkout the source to your home directory like this: cd mkdir mozilla cd mozilla hg clone http://hg.mozilla.org/mozilla-central/ src== Configuration ==
It is still possible You need to checkout older versions of Firefox using cvs as described below but Mercurial is preferred: cd cvs -d :pserver:anonymous@cvs-mirrorcreate a hidden file for the build system that contains instructions on how you want your build completed.mozilla.org:/cvsroot co mozilla/client.mk cd ~/mozilla make -f client.mk checkout MOZ_CO_PROJECT=browser
Create and open a hidden file called .mozconfig in your home directoryusing notepad or vim:
notepad.exe ~/.mozconfig
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --disable-static --enable-shared
If you are using a multi-core computer for building, you can try adding a flag to speed up compile times. Use a value of ''((# of cores)*2)+1'' (ie. five for two cores):
mk_add_options MOZ_MAKE_FLAGS=-j5
For OS X (Leopard) add: ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk For Windows XP it may be necessary to add the following additional line to your .mozconfig file: ac_add_options --disable-vista-sdk-requirements Visual Studio 2008 users may also need to add one or more of the following to .mozconfig:
ac_add_options --disable-xpconnect-idispatch
ac_add_options --disable-activex
ac_add_options --disable-parental-controls
Start == Getting the build: cd ~/mozilla/src make -f client.mk buildsource ==
Once If you are attempting to build Firefox 3.1 or greater you can checkout the source using mercurial as described below. When creating a working directory and checking out the source it doesn't really matter where you put it, but avoid paths that contain spaces. Spaces in the path name will cause the build to fail. For Windows XP users, your home directory path almost certainly has spaces. If that is finished the case, just put the mozilla directory in your root (ie. C:\mozilla) and put the .mozconfig file in that directory. If your user name doesn't have space you should set can checkout the following environment variable source to turn-off assertion dialogsyour home directory like this: export XPCOM_DEBUG_BREAK=warncd mkdir mozilla cd mozilla hg clone http://hg.mozilla.org/mozilla-central/ src
When you run Firefox for the first time, create and select a new profile called "development" (or any name of your choice) It is still possible to avoid corrupting your current profile. You can do this while running your current version checkout older versions of Firefox using these command line optionscvs: ~cd cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/srcclient.mk cd ~/obj*/dist/bin/firefox mozilla make -Profilemanager -no-remotef client.mk checkout MOZ_CO_PROJECT=browser
The finished == Starting the build can be found in the ~/mozilla/src/obj*/dist/bin directory.==
Run You need to change to the file "mozilla" or "firefox", not directory that contains the source code and then run the binary "make command: cd ~/mozilla/src time make -bin" or "firefox-bin"f client.mk build
== Windows notes Running the build ==
The instructions are Once the same as for Windows Vista and XP. For Firefox 3, the Vista SDK build is also required. However, for XP it may be necessary to add finished you should set the following additional line environment variable to your .mozconfig fileturn-off assertion dialogs: ac_add_options --disable-vista-sdk-requirementsexport XPCOM_DEBUG_BREAK=warn
For more info about Visual Studio 2008 problems see [http://crashopensource.blogspot.com/2008/05/vista-building-with-vc9.html Lukas Blakk's blog]When you run your build for the first time, create and select a new profile called "development" (or any name of your choice) to avoid corrupting your current profile.
Another problem is that you may not be able to use your home directory because the path almost certainly has spaces. If that is the case, just put the mozilla directory in your root (ie. CWindows and Linux:\ ~/mozilla) and put the .mozconfig file in that directory. Spaces in the path name will cause the build to fail./src/obj*/dist/bin/firefox -profilemanager
For more detailed info about the windows build requirements visit [httpOS X: ~/mozilla/developersrc/obj*/dist/MinefieldDebug.mozilla.orgapp/enContents/docsMacOS/Windows_Build_Prerequisites#Microsoft_Visual_C.2B.2B_and_Windows_SDK Mozilla Developer Center].firefox
For more information on using Mercurial to checkout Mozilla code see [http://developer.mozilla.org/en/Mozilla_Source_Code_(Mercurial) Mozilla Source Code].== Updating a build ==
For more detailed information about Mozilla building visit [http://zenit.senecac.on.ca/wiki/index.php/Real_World_Mozilla_Build_Mozilla_Lab Real World Mozilla Build Lab]. == Building on Ubuntu and Fedora == Install build pre-requisites for Fedora 10 users: su -c "yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'" su -c "yum install mercurial autoconf213 libXt-devel" Install Firefox 3 build re-requisites for Ubuntu 8.10 users: sudo apt-get install build-essential sudo apt-get build-dep firefox sudo apt-get install mercurial libasound2 libasound2-dev curl libcurl4-gnutls-dev Checkout the source: mkdir ~/mozilla cd ~/mozilla hg clone http://hg.mozilla.org/mozilla-central/ src 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 If you are using a multi-core computer for building, you can try adding a flag need to speed up compile times. Use a value of ((# of cores)*2)+1 (ie. five for two cores):  mk_add_options MOZ_MAKE_FLAGS=-j5 Start refresh the buildsource code:
cd ~/mozilla/src
make hg pull -f client.mk build Here is a log of the output from building Firefox 3.1 on Ubuntu 8.04: http://zenit.senecac.on.ca/wiki/imgs/Build_output.txt.zip 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/src/obj*/dist/bin/firefox -Profilemanager -no-remote The finished build can be found in the ~/mozilla/src/obj*/dist/bin directory.u
Run == Rebuilding the file "mozilla" or "firefox", not the binary "mozilla-bin" or "firefox-bin"browser ==
For more detailed information visit [[Real_World_Mozilla_Build_Mozilla_Lab|Real World Mozilla Build Lab]]If you want to rebuild the entire browser just repeat the instructions for starting the build above. However, it is possible to do incremental builds where only the source code you have changed is compiled.
== Building on OS X ==For instance, to rebuild after a change in the xpcom module try: make -C ~/mozilla/src/obj*/xpcom
Build preOr as a more general form: make -requisites and instructions for OS X can also be found at C [the [http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites#Firefox_Quick_Start Mozilla Developer Center.object directory corresponding to the source directory that has changed]
If In most cases this will relink the changes and create a new browser binary. But there's not hard and fast rule about when you can successfully do an incremental build. Sometimes you have built Firefox in your home directory can burrow a few levels into the object tree and are trying sometime you need to start it build from the command line try these steps: cd ~/mozilla/src/obj*/dist/MinefieldDebugvery top.app/Contents/MacOS It may take a bit of trial and error to discover what works./firefox -Profilemanager
= Tunneling a VNC session =

Navigation menu