Installation of Firefox

There are two major methods for building Firefox. In the standard case, the entire
suite of libraries is built and installed. In the other, most of
the system is built using the procedures found in Xulrunner-23.0.1. This is advantageous if
you are planning to build other related packages such as IcedTea-Web-1.4. With either build method,
you need to run the main build procedure below with the appropriate
options in the mozconfig file. Then
use the appropriate install instructions depending on the chosen
build method.

The configuration of Firefox is
accomplished by creating a mozconfig
file containing the desired configuration options. A default
mozconfig is created below. To see
the entire list of available configuration options (and an
abbreviated description of each one), issue ./configure --help. You may also
wish to review the entire file and uncomment any other desired
options. Create the file by issuing the following command:

cat > mozconfig << "EOF"
# If you have a multicore machine, firefox will now use all the cores by
# default. Exceptionally, you can reduce the number of cores, e.g. to 1,
# by uncommenting the next line and setting a valid number of CPU cores.
#mk_add_options MOZ_MAKE_FLAGS="-j1"
# If you have installed DBus-Glib comment out this line:
ac_add_options --disable-dbus
# If you have installed wireless-tools comment out this line:
ac_add_options --disable-necko-wifi
# If you have installed libnotify comment out this line:
ac_add_options --disable-libnotify
# Uncomment these lines if you have installed optional dependencies:
# GStreamer is necessary for H.264 video playback in HTML5 Video Player
#ac_add_options --enable-gstreamer
#ac_add_options --enable-system-hunspell
#ac_add_options --enable-startup-notification
# Uncomment this line if you compiled Cairo with --enable-tee switch and want
# to use it instead of the bundled one:
#ac_add_options --enable-system-cairo
# If you have not installed Yasm then uncomment this line:
#ac_add_options --disable-webm
# If you have installed xulrunner uncomment the next two ac_add_options lines
# and check that the sdk will be set by running pkg-config in a subshell
# and has not become hardcoded or empty when you created this file
#ac_add_options --with-system-libxul
#ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
# Comment out following options if you have not installed
# recommended dependencies:
ac_add_options --enable-system-sqlite
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
# It is recommended not to touch anything below this line
ac_add_options --prefix=/usr
ac_add_options --enable-application=browser
ac_add_options --disable-crashreporter
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --disable-debug
ac_add_options --disable-tests
ac_add_options --enable-optimize
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --enable-gio
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-url-classifier
ac_add_options --enable-system-ffi
ac_add_options --enable-system-pixman
ac_add_options --with-pthreads
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-png
ac_add_options --with-system-zlib
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir
EOF

If you are building against an already installed Xulrunner apply the patch:

patch -Np1 -i ../firefox-23.0.1-search_box_fix-1.patch

If you are building against a system-installed Cairo apply the patch:

patch -Np1 -i ../firefox-23.0.1-system_cairo-1.patch

Compile Firefox by issuing the
following commands:

sed -i 's@ ""@@' browser/base/Makefile.in &&
make -f client.mk

This package does not come with a test suite.

If you have not linked
Firefox against an installed
Xulrunner:

make -C firefox-build-dir/browser/installer

Now, as the root user, if you have
not linked Firefox against an installed Xulrunner, install the package:

NPAPI Headers

The above instructions just install the parts you need to run
Firefox. If you want to compile
gnash-0.8.10, the open source version of Flash,
copy some headers that Gnash needs into /usr/include, as the
root user:

Note

You don't need to install the headers if you have built
Firefox against Xulrunner.

Command Explanations

sed -i 's@ ""@@'
browser/base/Makefile.in: This sed removes an
unprintable control character from the title bar.

make -f client.mk
...: Mozilla products are packaged to allow the use
of a configuration file which can be used to pass the configuration
settings to the configure command. make uses the client.mk file to get initial configuration and
setup parameters.

make -C
firefox-build-dir/browser/installer: this creates a
Firefox tarball similar to the
ones you can download from Mozilla.

tar -xfv firefox-build-dir/dist
...: This untars Firefox in /usr/lib. The --strip-components=1 option removes the leading
'firefox' directory from the filenames, allowing us to untar it
into a versioned directory.

make -C firefox-build-dir
install: This runs make install in
firefox-build-dir.

ln -sv ...
/usr/lib/firefox-23.0.1: This command creates a
symbolic link to /usr/lib/mozilla/plugins. It's not really needed,
as Firefox checks /usr/lib/mozilla/plugins by default, but the
symbolic link is made to keep all the plugins installed in one
folder.

Configuring Firefox

If you deleted the --disable-webm
option from your mozconfig, your
Firefox can play most YouTube
videos without the need for the flash plugin. To enable this, go to
http://www.youtube.com/html5 and
click on 'Join the HTML5 Trial' (needs cookies enabled).

If you use a desktop environment like Gnome or KDE
you may like to create a firefox.desktop file so that Firefox appears in the panel's menus. If you
didn't enable startup-notification in your mozconfig change the
StartupNotify line to false. As the root user: