wiki:firefox

Version 2 (modified by andy@…, 18 years ago) ( diff )

--

Please login and fix my errors

Compiling Firefox and Thunderbird From CVS

The Mozilla developers tend to be cautious, making stable releases quite infrequently. Meanwhile active development continues on cvs head. Compiling Firefox and Thunderbird from cvs isn't hard. Obviously you'll need cvs http://www.linuxfromscratch.org/blfs/view/svn/basicnet/netprogs.html#cvs. First, decide where you're going to keep the code. The mozilla tree weighs in at more than 300Mb so it makes sense to use the same code for both Firefox and Thunderbird. First cd into a suitable folder and then login to cvs

export CVSROOT=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot"
cvs login

Just press enter when it asks you for a password. Then checkout some configuration files

cvs co -f mozilla/client.mk
cvs co -f mozilla/browser/config/mozconfig
cvs co -f mozilla/mail/config/mozconfig

Now create a suitable mozconfig for Firefox

cat > mozilla/mozconfig-fox << "EOF"
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --prefix=/usr
ac_add_options --disable-installer
EOF

And one for Thunderbird

cat > mozilla/mozconfig-bird << "EOF"
. $topsrcdir/mail/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/thunderbuild
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --prefix=/usr
ac_add_options --disable-installer
EOF

Create a folder to make a backup copy of the finished builds

mkdir tarballs

Now you can build Firefox with these commands

cd mozilla
ln -sf mozconfig-fox mozconfig
rm -rf firefox-build
make -f client.mk
make -C firefox-build/browser/installer
cp firefox-build/dist/firefox-3.0a1.en-US.linux-i686.tar.bz2 ../tarballs/firefox-$(date +%d-%m-%y).tar.bz2

If you put those commands in a script it makes it easy to automate it and do a weekly build. The first time it is run it will take forever for cvs to pull the code (depending on the speed of you internet connection).
Building Thunderbird is basically the same

cd mozilla
ln -sf mozconfig-bird mozconfig
rm -rf thunderbuild
make -f client.mk
make -C thunderbuild/xpinstall/packager
cp thunderbuild/dist/thunderbird-3.0a1.en-US.linux-i686.tar.bz2 ../tarballs/thunderbird-$(date +%d-%m-%y).tar.bz2

The date in that command is in the European format, so tweak that to suit yourself.

To run the finished build, untar it somewhere suitable and run the {firefox,thunderbird} script in the folder, just like the tarballs you can download from Mozilla.
I find it convenient to run them in my home folder, it saves having to login as root and it means that nothing I do here can screw up my carefully crafted BLFS system.

Tweak the Build

If I have to start afresh, I like Firefox to create the default profile with my bookmarks already there. To do this, copy ~/.mozilla/firefox/<random number>/bookmarks.html into the mozilla source, mozilla/browser/locales/en-US/profile/bookmarks.html then the next time you run the build script they'll be built in. If it causes a problem for cvs then delete the file and run the build script again, cvs will replace it.
Another file that's ripe for tweaking is mozilla/browser/app/profile/prefs.js which, when it becomes the prefs.js file in you profile, stores many imporant settings (font sizes and suchlike).

Note: See TracWiki for help on using the wiki.