CompileFirefoxNewVersion
This is a guide for compiling firefox 1.5.* on Ubuntu Breezy 5.10.
Install necessary development packages:
$ sudo apt-get install build-essential libgtk2.0-dev libidl-dev libxt-dev libgnomevfs2-dev
Download and extract firefox source tar ball:
$ wget \ http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.5.0.1/source/firefox-1.5.0.1-source.tar.bz2 $ tar jxvf firefox-1.5.0.1-source.tar.bz2 $ cd mozilla
Create the .mozconfig file in the firefox source directory:
$ cat > .mozconfig <<EOF . \$topsrcdir/browser/config/mozconfig export MOZILLA_OFFICIAL=1 export BUILD_OFFICIAL=1 mk_add_options MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 ac_add_options --enable-official-branding mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-bin ac_add_options --enable-default-toolkit=gtk2 ac_add_options --enable-pango ac_add_options --with-user-appdir=.mozilla ac_add_options --with-system-png=/usr ac_add_options --with-system-jpeg=/usr ac_add_options --enable-postscript ac_add_options --disable-installer ac_add_options --disable-xprint ac_add_options --enable-crypto ac_add_options --enable-strip-libs ac_add_options --enable-canvas ac_add_options --enable-svg ac_add_options --enable-svg-renderer=cairo ac_add_options --enable-system-cairo ac_add_options --enable-mathml ac_add_options --disable-tests ac_add_options --disable-gtktest ac_add_options --disable-debug ac_add_options --enable-xft ac_add_options --enable-optimize="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer" ac_add_options --with-system-zlib=/usr ac_add_options --without-system-nspr ac_add_options --enable-xinerama ac_add_options --enable-extensions=default ac_add_options --disable-pedantic ac_add_options --disable-long-long-warning ac_add_options --enable-single-profile ac_add_options --disable-profilesharing ac_add_options --enable-gnomevfs ac_add_options --disable-updater EOF
Note: You may need to adapt the --enable-optimize gcc parameters to your own platform. Pay special attention to the "march" and "mtune" parameters. If they are speicified for the wrong architecture, you may not be able to compile Firefox. To see what architectures are available with gcc, type:
man gcc
and then navigate to the section titled "Intel 386 and AMD x86-64 Options." In this section is a list of supported architectures for the "march" and "mtune" options. Choose the option closest to your CPU.
Build firefox:
$ make -f client.mk build $ make -C firefox-bin/browser/installer/
Follow the instructions in FirefoxNewVersion to install your newly built firefox-1.5.*.tar.gz, which can be found in mozilla/firefox-bin/dist/.
Third Party builds
If for some reason you do not want to go through the process of compiling Firefox but would like to enjoy the benefit of a gcc4 compiled build, you can visit the Mozillazine forum Third Party/Unofficial Builds section to look for pre-compiled builds made by third parties.
For example, in Ubuntu forum there is discussion on AthlonXP optimized gcc4 build such as Swiftfox.
CompileFirefoxNewVersion (last edited 2008-08-06 16:35:53 by localhost)