Building custom firefox (like swift{fox|weasel}

UPDATED 2010/11/21:  Firefox, v. 3.6.12:

UPDATED 2009/9/8:  Swiftfox is now available at v. 3.5.2 (incl. PGO build for Prescott) and is again being actively updated, but I still think my custom build is FASTER (non-PGO build specifically for Intel Core Duo Prescott) + I’m a control freak who would prefer not to use a binary blob as a browser, for security reasons, if nothing else! 😉

I have long been a fan of Swiftfox, a prebuilt binary version of Firefox optimized for specific processor platforms. I seems though that Swiftfox is no longer being updated (v3.0.4pre1 is latest). I then tried “swiftweasel”, a similar program for “iceweasel” that is more current, but, even though faster than Firefox, gives me some scrolling problems (page sometimes keeps scrolling after releasing mouse-wheel and sometimes scrolls up and down, which is very annoying). So, I took the plunge and downloaded the source for Firefox and built with similar options to Swiftfox (see “about:buildconfig”). This seems to work well for me so far! Here’s what I did:

1) Download code from: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/

2) Create a temp. directory to untar in.

3) Create .mozconfig in that directory containing:

# This file specifies the build flags for Firefox.  You can use it by adding:
#  . $topsrcdir/browser/config/mozconfig
# to the top of your mozc#onfig file.
#export LDFLAGS=”-s”
#make -f client.mk build MOZ_CURRENT_PROJECT=browser

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=/home/turnerjw/tmp/mozbuild/mozilla_trunk/obj-@CONFIG_GUESS@
export CFLAGS=”-march=prescott -mtune=prescott -O3 -fomit-frame-pointer -masm=att -mmmx -mfpmath=sse -finline-limit=100″
export CXXFLAGS=”-march=prescott -mtune=prescott -O3 -fomit-frame-pointer -masm=att -mmmx -mfpmath=sse -finline-limit=100″
ac_add_options –with-pthreads
ac_add_options –enable-application=browser
ac_add_options –disable-freetype2
ac_add_options –enable-single-profile
ac_add_options –enable-extensions=default
ac_add_options –disable-installer
ac_add_options –disable-tests
ac_add_options –enable-optimize
ac_add_options –disable-profilesharing
ac_add_options –disable-debug
ac_add_options –enable-xft
ac_add_options –enable-crypto
ac_add_options –enable-svg
ac_add_options –enable-canvas
ac_add_options –enable-update-packaging
ac_add_options –enable-libxul
ac_add_options –enable-webservices
ac_add_options –disable-crashreporter
ac_add_options –disable-mochitest
ac_add_options –enable-strip
##ac_add_options –enable-system-cairo
ac_add_options –disable-profile-guided-optimization
ac_add_options –enable-svg
ac_add_options –enable-macos-target=10.4
ac_add_options –enable-pthreads
ac_add_options –enable-prebinding
ac_add_options –disable-safe-browsing
ac_add_options –disable-debugger-info-modules
ac_add_options –disable-ipv6
ac_add_options –disable-logging
ac_add_options –disable-parental-controls
ac_add_options –disable-pedantic
ac_add_options –disable-v1-string-abi
ac_add_options –disable-startup-notification
mk_add_options MOZ_CO_PROJECT=browser
#NEXT 6 LINES ADDED FOR FF, v. 3.6.12 (2010/11/21):
ac_add_options –disable-necko-wifi
ac_add_options –disable-accessibility
ac_add_options –enable-pango
ac_add_options –enable-install-strip
ac_add_options –with-system-zlib
ac_add_options –disable-updater

4) ./configure

5) make -j2      #GO DO SOMETHING – THIS TAKES HALF AN HOUR (a/b as long as compiling a new kernel?!)!

6) cd dist/bin

7) ./firefox

Make sure works ok.

9) mv (rename) the top directory to /usr/lib/firefox###, so that the new
firefox is in “/usr/lib/firefox###/dist/bin/”.

Advertisements

Feel Free to Comment (Name/Email/Website optional):

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: