Originally Posted by
kevdog
So does anyone know of any instructions how to compile Firefox from source and configure the cflags and ldflags appropriately? I'd like to try to compile Firefox and run the test between the stock and compiled versions.
I'm not sure of how to do this in Ubuntu. In Arch there is already a nice AUR PKGBUILD script that is super easy to use.
I think you need to install this for ubuntu: https://developer.mozilla.org/en/Lin...es#Build_Tools
There is PGO building info for Linux here: https://developer.mozilla.org/en/Bui...ation#Building
This is the part of the Arch PKGBUILD that uses the "make -f client.mk profiledbuild" command as well as the LDFLAGS:
Code:
export LDFLAGS='-lX11 -lXrender'
LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX :99 &
XPID=$!
export DISPLAY=:99
sed -e 's/#CFLAGS#/'"$CFLAGS"'/g' <"$srcdir"/mozconfig >.mozconfig
LD_PRELOAD="" make -f client.mk profiledbuild MOZ_MAKE_FLAGS="${MAKEFLAGS}" || return 1
kill $XPID
make -j1 DESTDIR=${pkgdir} -C ff-opt-obj install || return 1
The part about the C[XX]FLAGS uses the ones that are already set in the Arch /etc/makepkg.conf file.
There is also the mozconfig:
Code:
# load defaults from src tarball
. $topsrcdir/browser/config/mozconfig
# add our own options
ac_add_options --enable-application=browser
ac_add_options --prefix=/usr --libdir=/usr/lib
ac_add_options --with-system-nspr --with-system-nss--with-system-jpeg --with-system-zlib --with-system-png
ac_add_options --with-pthreads
ac_add_options --enable-optimize="#CFLAGS#"
ac_add_options --enable-default-toolkit=cairo-gtk2 --disable-freetype2 --enable-xft --enable-system-cairo
ac_add_options --disable-tests --disable-installer --disable-debug --disable-profilesharing --enable-single-profile
ac_add_options --enable-official-branding
ac_add_options --enable-dbus
ac_add_options --enable-jemalloc
ac_add_options --enable-pango --enable-crypto --enable-svg --enable-canvas
ac_add_options --disable-xprint
ac_add_options --disable-crashreporter
ac_add_options --enable-xinerama
ac_add_options --enable-safe-browsing --enable-webservices
ac_add_options --enable-strip
#ac_add_options --enable-libxul --with-libxul-sdk=/usr/lib/xulrunner-devel-1.9
mk_add_options MOZ_MAKE_FLAGS=-j8
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt-obj
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
This has the part about PGO here:
Code:
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
And the part about C[XX]FLAGS here:
Code:
ac_add_options --enable-optimize="#CFLAGS#"
And the part about cairo:
Code:
ac_add_options --enable-default-toolkit=cairo-gtk2 --disable-freetype2 --enable-xft --enable-system-cairo
I'm sure someone can make a script for ubuntu, or you could modify your mozconfig file and use ./configure make with the correct build options or something.
One last thing..... it takes over and hour to build for me.
Also read this digg comment: http://digg.com/linux_unix/Firefox_F...9788#c23309788
Bookmarks