by Ralinx
Last updated: April 10 2002
(Transferred from Wiki by Peter)

I'm here to tell you how to compile Mozilla without compiling the entire thing, and making a nice package out of it that can easily be installed on just about any linux system. I'll also be adding optimisations so it should run a bit faster.
first thing on the list is to download the mozilla sources at try to get a milestone build (like 0.9.7 for example), if u want u could also use a nightly-source tarball but those don't always work.
for this PET i'll assume that u put the tarball in /usr/src so go to the /usr/src directory and untar the mozilla tarball by typing:
tar zxvf mozilla-source-0.9.7.tar.gz
then cd into the mozilla directory (/usr/src/mozilla) in that directory u have to create a file called .mozconfig make sure the file contains the following lines:
ac_add_options --disable-tests
ac_add_options --disable-debug
# don't compile jpg-support, use the jpg 
# library that's already installed on the system instead
ac_add_options --without-jpeg
# don't compile zlib-support, use the zlib library that's
# already installed on the system instead
ac_add_options --without-zlib
# don't compile png-support, use the png library that's 
# already installed on the system instead
ac_add_options --without-png
ac_add_options --enable-optimize="-O3 -march=i686"
# make sure we have https support and stuff like that
ac_add_options --enable-crypto
# enable nice fonts
ac_add_options --enable-xft
as u probably noticed the --enable-optimize line makes sure u will be compiling with optimisations if ur not using a i686 processor check the gcc manpage (or website) on what to put after -march= so it'll correspond to ur architecture
if u want to add extra options run ./configure --help from the mozilla source tree (/usr/src/mozilla) and then add every option u would like to the .mozconfig file like this:
ac_add_options <option_u_want>
after u created the .mozconfig file u have to set some environment variables execute the following commands:
allrighty, we are now ready to start compiling execute the following command from the the mozilla source tree (/usr/src/mozilla):
gmake -f build
if gmake isn't present on ur system u can just run this:
make -f build
this will take a while (about one hour and 45 minutes on my PIII 450)
when it's finished building we'll create a nice package out of it so u can easily install mozilla first goto the /usr/src/mozilla/xpinstall/packager directory when you're in that directory execute this command:
again, if gmake isn't present on ur system just run make
when this is finished u'll have ur very own mozilla package this package can be found in the /usr/src/mozilla/dist directory it's filename should be something like this: mozilla-i686-pc-linux-gnu.tar.gzcopy that file to another directory (preferably outside of /usr/src/mozilla because we'll be removing the mozilla source tree because it takes up way too many space)
when u've copied to mozilla package to another directory, simply remove /usr/src/mozilla
to install it, goto /usr/local (or any other directory where u would like to install it), and untar the mozilla package in that directory.
that's it, ur done by simply unpacking the package u have already installed it i always heard it's best to run mozilla as root for the first time after u installed ur own mozilla version so i guess u better do it too to run it, simply execute the following command in the /usr/local/mozilla directory:
after u ran it once as root, just run it as your regular user from then on. u can run this mozilla version by executing this:
(or u could add /usr/local/mozilla to your PATH so u can just start it by running the 'mozilla' command but then u better make sure no other mozilla version is located somewhere in your path)