Skip to content
XiaokangFan edited this page Jan 29, 2018 · 2 revisions

1 Install prerequisites (autoconf2.13 is required)

$ sudo apt-get install rustc cargo autoconf2.13 libgtk-3-dev libgconf2-dev libdbus-glib-1-dev libpulse-dev yasm

2 Get the source code of Firefox (e.g., version 58.0b9)

$ wget https://archive.mozilla.org/pub/firefox/releases/58.0b9/source/firefox-58.0b9.source.tar.xz
$ tar xvf firefox-58.0b9.source.tar.xz

3 Configure build options

3.1 Create a config file (mozconfig) under the root directory of the src tree

$ cd firefox-58.0b9
$ touch mozconfig

3.2 Edit config options

Add the following options into the config file (mozconfig)

mk_add_options MOZ_OBJDIR=$topsrcdir/obj-clang
mk_add_options MOZ_MAKE_FLAGS="-j8"
ac_add_options --enable-application=browser
ac_add_options CC=PATH_TO_CLANG
ac_add_options CXX=PATH_TO_CLANG++

4 Build Firefox

$ ./mach build
Clone this wiki locally