Firefox 1.0.4 + GTK1.2


Forum: Other Help Topics
Topic: Firefox 1.0.4 + GTK1.2
started by: friedgold

Posted by friedgold on July 07 2005,03:16
I've been trying to compile the latest firefox release against the gtk1.2 library. This way it can be run without downloading the gtk2 extension. I was hoping to keep the size to a minimum in the same way the version currently included with DSL is. I'd like to make a DSL extension when I'm finished, or maybe if I get it small enough it might even be considered for future versions of DSL.

The /usr/local/firefox directory takes up 17Mb (uncompressed) in the current DSL so thats what I'm aiming at. The version I compiled weighs in at 27Mb. I was hoping that whoever was responsible for the Firefox in DSL might have some suggestions.

The .mozconifg file I'm using is as follows

Code Sample
#
# See http://www.mozilla.org/build/ for build instructions.
#

. $topsrcdir/browser/config/mozconfig

# Options for 'configure' (same as command-line options).
ac_add_options --disable-toolkit-qt
ac_add_options --disable-toolkit-xlib
ac_add_options --enable-toolkit-gtk
ac_add_options --disable-toolkit-gtk2
ac_add_options --enable-default-toolkit=gtk
ac_add_options --enable-application=browser
ac_add_options --disable-mailnews
ac_add_options --disable-composer
ac_add_options --disable-irc
ac_add_options --disable-calendar
ac_add_options --disable-ldap
ac_add_options --disable-gnomevfs
ac_add_options --disable-gnomeui
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --disable-tests
ac_add_options --disable-freetype2
ac_add_options --disable-xprint
ac_add_options --disable-jsd
ac_add_options --disable-oji
ac_add_options --disable-accessibility
ac_add_options --disable-mathml
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-strip
ac_add_options --prefix=/usr/local


There plenty of compile options (see < here > for more details) its hard to find documentation the effects of some. I think I'm probably just gonna have to experiment to see what size effect they have

Posted by roberts on July 07 2005,21:24
John would be the one to answer this. It was his efforts that we have such a damnsmall version of FF.
Posted by friedgold on July 07 2005,21:47
Quote (roberts @ July 07 2005,17:24)
John would be the one to answer this. It was his efforts that we have such a damnsmall version of FF.

I'm starting to realise what a hard job that must of been. I've got the size down further to 23Mbs but I think I've probably exhausted what can be done using ./configure options and need to start pruning files manually.

Posted by friedgold on July 12 2005,16:41
Ok, I've got it down to 19Mbs (Uncompressed) and I'm going to send the extension I've made onto kent. The .mozconfig I used in the end is as follows

Code Sample

# See http://www.mozilla.org/build/ for build instructions.
#

# Options for 'configure' (same as command-line options).

# We're building firefox
export MOZ_PHOENIX=1
mk_add_options MOZ_PHOENIX=1
ac_add_options --enable-application=browser

# Extensions
ac_add_options --enable-extensions=cookie,xml-rpc,xmlextras,pref,universalchardet

# Use gtk1.2 toolkit
ac_add_options --disable-toolkit-qt
ac_add_options --disable-toolkit-xlib
ac_add_options --enable-toolkit-gtk
ac_add_options --disable-toolkit-gtk2
ac_add_options --enable-default-toolkit=gtk

# Use system libs
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-png

# Disable
ac_add_options --disable-mailnews
ac_add_options --disable-composer
ac_add_options --disable-irc
ac_add_options --disable-calendar
ac_add_options --disable-ldap
ac_add_options --disable-gnomevfs
ac_add_options --disable-gnomeui
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --disable-tests
ac_add_options --disable-freetype2
ac_add_options --disable-xprint
ac_add_options --disable-jsd
ac_add_options --disable-oji
ac_add_options --disable-accessibility
ac_add_options --disable-svg
ac_add_options --disable-mathml
ac_add_options --disable-logging
ac_add_options --disable-profilesharing

# Enable
ac_add_options --enable-crypto
ac_add_options --enable-single-profile

# Compile options
ac_add_options --enable-optimize="-Os"
ac_add_options --disable-debug
ac_add_options --enable-strip


I used the following script to strip out various bits when compiling firefox:

Code Sample

#!/bin/sh
SUITEBUILDROOT=/usr/local/src/mozilla
EXT_UP=TGZ
PACKAGENAME=firefox
export SUITEBUILDROOT,EXP_UP,PACKAGENAME

# compiling the build
function compilebuild()
{
echo Compiling the build...

cd $SUITEBUILDROOT
make -f client.mk build || exit
}

# cleaning the build
function cleanbuild()
{
echo Cleaning the build...

# Removing testfiles and other unneccessary files from build
rm -rf $SUITEBUILDROOT/dist/bin/res/html
rm -rf $SUITEBUILDROOT/dist/bin/res/rdf
rm -rf $SUITEBUILDROOT/dist/bin/res/samples
rm -rf $SUITEBUILDROOT/dist/bin/res/throbber
rm -f $SUITEBUILDROOT/dist/bin/res/bloatcycle.html
rm -f $SUITEBUILDROOT/dist/bin/res/ignore-test.xul
rm -f $SUITEBUILDROOT/dist/bin/res/sample.unixpsfonts.properties
rm -f $SUITEBUILDROOT/dist/bin/res/viewer.properties
rm -f $SUITEBUILDROOT/dist/bin/bloaturls.txt
rm -f $SUITEBUILDROOT/dist/bin/mangle
rm -f $SUITEBUILDROOT/dist/bin/shlibsign
rm -f $SUITEBUILDROOT/dist/bin/TestGtkEmbed
rm -f $SUITEBUILDROOT/dist/bin/xpcshell
rm -f $SUITEBUILDROOT/dist/bin/xpidl
rm -f $SUITEBUILDROOT/dist/bin/xpt_link
rm -f $SUITEBUILDROOT/dist/bin/xpt_dump

# Removing empty directories and unneccessary files from chrome
rm -rf $SUITEBUILDROOT/dist/bin/chrome/classic
rm -rf $SUITEBUILDROOT/dist/bin/chrome/comm
rm -rf $SUITEBUILDROOT/dist/bin/chrome/embed-sample
rm -rf $SUITEBUILDROOT/dist/bin/chrome/en-US
rm -rf $SUITEBUILDROOT/dist/bin/chrome/modern
rm -rf $SUITEBUILDROOT/dist/bin/chrome/pipnss
rm -rf $SUITEBUILDROOT/dist/bin/chrome/pippki
rm -rf $SUITEBUILDROOT/dist/bin/chrome/toolkit
rm -f $SUITEBUILDROOT/dist/bin/chrome/chromelist.txt

# Removing some jar files from chrome
cd $SUITEBUILDROOT/build/dist/bin/chrome
rm -f embed-sample.jar
sed --in-place --line-length=0 -e '/embed/d' installed-chrome.txt
}

# making the package
function makepackage()
{
echo Making the package...

# Making compressed package
cd $SUITEBUILDROOT/xpinstall/packager
make -C $SUITEBUILDROOT/xpinstall/packager MOZ_PKG_FORMAT=$EXT_UP PKG_BASENAME=$PACKAGENAME || exit
}

compilebuild
cleanbuild
makepackage

Posted by cbagger01 on July 13 2005,03:36
Nice job with the documented recompile process.

This should make it possible to quickly recompile GTK1.2 firefox whenever a small, incremental (1.0.x) security fix is made.

Now if John could provide the missing piece of the puzzle (how to get rid of that extra 2MB), then so much the better. I am sure that some of the extra space is taken up by new code that has been introduced between versions 0.9.1 and 1.0.4 but not all of it.

In the meantime, having a small Firefox1.0.4.uci extension without the GTK2 dependencies is a nice option to have.

Posted by ke4nt1 on July 13 2005,04:50
I have forwarded it to John to receive the "majik fingers"  treatment.

I will also release it as .tar.gz and .uci , once well tested and run-thru..

Thanks for the contribution..

73
ke4nt

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.