wiki:firefox

Version 18 (modified by Luca, 17 years ago) ( diff )

--

Firefox

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 --enable-static
ac_add_options --disable-shared
ac_add_options --prefix=/usr
ac_add_options --disable-installer
ac_add_options --enable-extensions=default,spellcheck
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 LDFLAGS=-lpangoxft-1.0 -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 (slight exaggeration) 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 it's just like the tarballs you can download from Mozilla. Untar it somewhere suitable and run the {firefox,thunderbird} script in the folder.
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. It is possible to run (as root) make -f client.mk install, then it will install Firefox in /usr (or Thunderbird, depending which mozconfig the symbolic link is pointing too). But I wouldn't recommend it, unless you've thoroughly road tested the build first.
For one thing, you can't build Yelp (Gnomes help browser) linked against a current cvs Firefox build because it no longer installs libgtkembedmoz.so.
If you do install it system side, but later change your mind and want to delete it again, these commands will remove Firefox

rm -f /usr/{bin,lib/pkgconfig}/firefox*
rm -f /usr/share/aclocal/nspr.m4
rm -rf /usr/{lib,include,share/idl}/firefox-3.0a1

And these commands will remove Thunderbird

rm -f /usr/{bin,lib/pkgconfig}/thunderbird*
rm -rf /usr/{lib,include,share/idl}/thunderbird-3.0a1

It's safer not to take the risk. Just run it in your home folder.

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). Firefox is picky about the syntax of that file so it's probably best not to edit it directly. Alter it by entering about:config in Firefoxs addressbar, make the changes you want, close Firefox and then copy the prefs.js from your profile.

Building on non-x86 architectures

Most architectures seem to have flakey handling of the visibility pragma. If you encounter errors such as

undefined reference to `memcpy@@GLIBC_2.0'

you need to add the following to your .mozconfig

ac_cv_visibility_pragma=no

Building localized versions

It should apply to all Mozilla-based packages and versions; I built this way Firefox/Thunderbird-1.5.x, 2.x and CVS, Seamonkey-1.x, NVU-0.x and 1.x and Sunbird-0.3.x.

In the mozconfig-* file it is possible to add the following two lines:

ac_add_options --enable-ui-locale=<ll>
mk_add_options MOZ_CO_LOCALES=<ll>

According to [path-to-sources]/mozilla/toolkit/locales/all-locales working and integrated locales are: cs, el, fi, fr, ga-IE, he, hu, it, nb-NO, nl, pl, ro, sv-SE, ru; missing localizations can be done manually by simply translating the stuff from original American-English to the desired one (example: I installed Thunderbird-2.0a1 localized but since it-sources are not available for that version I translated myself EN-US ones to it and placed them in [path-to-sources]/l10n/it hierarchy, used the same commands and now I use Thunderbird in italian). The localized files may have a different version number (example: Firefox-2.x uses it "langpack" 1.8.1 so it is worth to take a look before building to avoid missing xul, xml references and so on). It could be that a file or some files are missing from downloaded localization (example: for Firefox-CVS it prompts.properties is missing so I simply copied the original EN-US one and translated myself) but all that's needed is some patience; there are some tools that can be used to translate, the only one I tried is mozilla translator http://sourceforge.net/projects/moztrans/. Oher infos can be found at http://www.mozilla.org/projects/l10n/mlp_tools.html and http://www.mozilla.org/projects/l10n/mlp_howto_Firefox.html.

Up
Top

Note: See TracWiki for help on using the wiki.