This service provided by BeBits: The Best Source of BeOS Software!
BuildingFirebird
BeBits > TableOfContents > DeveloperArea > HowTo

How to Build Mozilla or Firefox (Firebird) :

** Note: This is a work in progress, and will be split into separate WIKI pages soon. **
** Note: For building Mozilla in Haiku, see http://ports.haiku-files.org/wiki/www-client/mozilla-firefox/2.0.0.21pre/1 **

Trunk Building Is Broken

As of 2007-02-06, all Firefox builds require the use of the Cairo graphics engine. BeOS does not currently have all the needed prerequisites to build Cairo, so the instructions below only apply to building Firefox from the 1.8 branch code.

Prerequisites

  • Lots of diskspace, roughly 1 - 2 GB free
    (My current build-tree is 560MB, stripped)
  • A lot of time, roughly 1 - 2 hours.
    (CVS downloads of files takes 1-2 hours on a 10MBit line and builds take approx. 1.5 hours, if nothing goes wrong)
  • A lot of memory, no less than 256 MB.
  • A lot of patience
    (Build in one go? Yeah, right...)
  • An updated version of the 'make' utility, version v3.79 or better.
  • An updated version of the 'Perl' utility, version 5.8.0 or better.
  • An updated version of the 'CVS' utility, version 1.11 or better.
  • An updated version of Oliver Tappe's gcc compiler, version 2.95.3-xxxxxx.
  • Don't use OpenBeOS ld
    (It doesn't work with libIDL and gLIB-building as discussed later.)

Preparing To Build

  • Setting Up The Tools

    Note: Zeta already comes with make, perl and CVS; so Zeta users need not install these three.

    1. Installing The 'make' Utility.
      - Download make from BeBits. (http://www.bebits.com/app/2394, bezilla.beuser.de mirror)
      - Unpack it, but don't run the install.sh script. ( It replaces your original make file and it may come in handy some day )
      - Right click the make file and choose "Get Info", check that Execute Permissions are checked, if not check them ( at least for owner )
      - Move the unpacked make file to /boot/home/config/bin
      - Start a terminal and run:

      make --version

      - Make sure it says "GNU Make version 3.79.1" or better because Mozilla needs 3.79 or better to build properly.

    2. Installing The 'Perl' Utility.
      - Download Perl from BeBits. (http://www.bebits.com/app/2171 or from the bezilla.beuser.de mirror : perl-5.8.0 R5, perl-5.8.0 Bone, pearl-5.8.0 Dan0
      - Follow the installation instructions... ( Unpack it and run the package-file )
      - Start a terminal and run:

      perl --version

      - Make sure it says "This is perl, v5.8.0" or something like that. It may change if it's updated to a newer version. You need at least 5.8.0 though.

    3. Installing the 'CVS' Utility.
      - Download CVS from BeBits. (http://www.bebits.com/app/1610, bezilla.beuser.de mirror)
      - Unpack it to where you would like the cvs-dir to be installed.
      - Create a link inside your /boot/home/config/bin to the cvs binary.
      - Alternatively you can just move the cvs binary to /boot/home/config/bin and remove the cvs dir.
      - Right click the cvs file and choose "Get Info", check that Execute Permissions are checked, if not check them ( at least for owner )
      - Start a terminal and run:

      cvs --version

      - Make sure it says "Concurrent Versions System (CVS) 1.11 (client/server)" or something like that. It may change if it's updated to a newer version.

    4. Installing Oliver Tappe's gcc compiler.
      - Download gcc-2.95.3 from BeBits. (http://www.bebits.com/app/4011, bezilla.beuser.de mirror)
      - Expand the archive and follow the installation directions.
      - Additional Note for Net_Server /boot/develop/tools/gcc-2.95.3_binutils-2.15/lib/gcc-lib/i586-pc-beos/2.95.3-beos-041202/specs is a symlink to specs.Default, which lacks -lnet entry. To correct this, relink specs to specs.R5 in same folder.
    5. Installing 'glib' and 'libIDL'

    6. - Download glib & libIDL-Fixed Buildscript from bezilla.beuser.de mirror. (517 kB)

      - Expand it to your /boot/home directory. (Or anywhere else but remember to change instructions about glib & libIDL accordingly.) NOTE: The --original-- buildscript DOES NOT LIKE spaces in path.
      - ORIGINAL glib & libIDL
      - Expand it to your /boot/home directory. (Or anywhere else but remember to change instructions about glib & libIDL accordingly.) NOTE: The buildscript DO NOT LIKE spaces in path.
      - Start a terminal and run:

      cd /boot/home/glib-libIDL-beos
      ./buildscript

      This will start creating the libraries and if successful, you'll see something like:

       
      **********************************************
      The support libraries have been built and installed, please set these environment
      variables before running the main Mozilla 'configure' script:
      export GLIB_CONFIG=/boot/home/glib-libIDL-beos/glib/bin/glib-config
      export LIBIDL_CONFIG=/boot/home/glib-libIDL-beos/libIDL/bin/libIDL-config
      **********************************************
      

      Note: When building on Zeta, conftest will crash. That's not a problem - just click OK and the build will continue.

      The /boot/home/glib-libIDL-beos/glib/bin/ part of the display will probably be different if you unpacked it somewhere else. We will come back to the export lines above so keep them handy ( maybe paste them in a new StyledEdit window )

      NOTE: I could not get this buildscript to run correctly with OpenBeOS ld. It took me a week to find that out.

  • Setting up The Mozilla Configuration

    The .mozconfig File

    Mozilla configuration is in a .mozconfig file, and controls many things, such as whether to build Mozilla or Firefox. It can be in your /boot/home folder or the Mozilla folder you may have created.

    I have mine in /boot/home and I havn't tried doing it in another way, so you should do the same.

    ** Note: Use the GLIB_CONFIG and LIBIDL_CONFIG settings from glib & libIDL installation **

    Example .mozconfigs : http://ports.haiku-files.org/browser/haikuports/trunk/www-client/mozilla-firefox/mozconfig

    Open StyledEdit (or your preferred editor) and add the following lines to the end of the file:

     
                                  
    #** START OF USER MODIFICATIONS **
    

    # This is a comment, and has the # character in front.

    # Uncomment this line to Build firefox # . $topsrcdir/browser/config/mozconfig

    # Uncomment this line to buiild Thunderbird #. $topsrcdir/mail/config/mozconfig

    # Uncomment this line to build Calander (Sunbird) #. $topsrcdir/calendar/sunbird/config/mozconfig

    # Comment this out if not building Mozilla suite (SeaMonkey) mk_add_options MOZ_CO_PROJECT=suite ac_add_options --enable-application=suite

    # These should point to your glib and libIDL configuration make sure they do. export GLIB_CONFIG=/boot/home/glib-libIDL-beos/glib/bin/glib-config mk_add_options GLIB_CONFIG=/boot/home/glib-libIDL-beos/glib/bin/glib-config

    export LIBIDL_CONFIG=/boot/home/glib-libIDL-beos/libIDL/bin/libIDL-config mk_add_options LIBIDL_CONFIG=/boot/home/glib-libIDL-beos/libIDL/bin/libIDL-config

    # These points to the CVS where Mozilla sources are and should not change export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot mk_add_options CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

    # Required to download the 2.x branch the source code # Firefox 3 cannot currently be built with BeOS's old 2.95 gcc mk_add_options MOZ_CO_TAG=MOZILLA_1_8_BRANCH

    # Use this to place all the object files in a seperate directory # (Useful for building multiple projects from the same tree) # mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/some_subdir

    # These are the settings I recommend you ONLY CHANGE if you want to experiment # on you own and AFTER you've done A FEW SUCCESSFUL BUILDS. # I spent a week trying different configurations and this is a nice one. # Trust me.

    # Make sure not to use --disable-cpp-rtti -- it is required on BeOS (it is also # on by default for this OS)

    #Automatic updater is not currently supported on BeOS and does not build. So don't build it. ac_add_options --disable-updater

    # Some other stuff I've disabled. ac_add_options --disable-accessibility

    # Don't think printing is working, but I don't know. # Maybe you can uncomment this if you want to try. ac_add_options --disable-postscript

    # We don't have Java for BeOS yet. While this builds fine, it is not useful. ac_add_options --disable-oji

    # No need to build ipv6 in BeOS right now as BeOS don't have ip version 6. ac_add_options --disable-ipv6

    # Assume Cairo support is not available ac_add_options --disable-svg ac_add_options --disable-canvas

    # These are for debugging purposes. ac_add_options --disable-debug ac_add_options --disable-tests ac_add_options --disable-logging ac_add_options --disable-dtd-debug # Disables jsd, a requirement for venkman (JavaScript Debugger) ac_add_options --disable-jsd

    # Don't be to hard on us while we're building. # It's mostly for developers and debugging purposes. ac_add_options --disable-pedantic

    # Strip the objects, makes files smaller at the expense of not being able to debug properly. ac_add_options --enable-strip ac_add_options --enable-strip-libs

    # Optimizing for size. It's basically same as -O2 but tries to reduce size also. # -O2 should work, both of those may introduce bugs though (-O3 had many problems before) ac_add_options --enable-optimize=-Os # The first optimize doesn't work very well for mozilla builds. # It prevents URL drop-down menu from smart browsing to work. So use that one instead. #ac_add_options --enable-optimize ########################### # Optional features, disabled by default # You might want to enable these features by removing the # in front of the # ac_add_options lines.

    # Calendar extension # ac_add_options --enable-calendar

    # Uncommenting this may add speedups (and maybe decrease stability) # but BUILD IT COMMENTED FIRST #ac_add_options --enable-reorder

    # Don't use cpp exceptions. Other BeOS programs usually don't use this so why should we? # ac_add_options --enable-cpp-exceptions

    # Make Firefox call itself Firefox and not "Deer Park" # ac_add_options --enable-official-branding

    #** END OF USER MODIFICATIONS **

    Ok, now save this to /boot/home/.mozconfig Note the dot in front of the name of the mozconfig file. We are now ready to start building Mozilla or Firefox (ex-Firebird and ex-Phoenix).

Building Mozilla

  • Getting the Mozilla Build-File ( mozilla/client.mk )

    The Mozilla sources are availble to download thru CVS. You only need to get one file from cvs and this is the mozilla/client.mk that handles downloading and building.

    - Start a new Terminal.
    - Go to the directory where you want your mozilla project directory to be created.
    - Type the following to tell CVS from which server we should get the file from:

    export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

    - Type the following to make the mozilla directory and download the client.mk file:

      cvs co -r MOZILLA_1_8_BRANCH mozilla/client.mk

    If you're building Firefox you also need to do:

      cvs co -r MOZILLA_1_8_BRANCH mozilla/browser/config/mozconfig

    If you're building Thunderbird you also need to do:

      cvs co -r MOZILLA_1_8_BRANCH mozilla/mail/config/mozconfig

    If you're building Sunbird you also need to do:

      cvs co -r MOZILLA_1_8_BRANCH mozilla/calendar/sunbird/config/mozconfig


     NOTE: Until the issues, which prevent building on trunk, are resolved

            using  `cvs co -r MOZILLA_1_8_BRANCH ...`  pulls from the correct branch.  If you want the current trunk source, leave out "-r MOZILLA_1_8_BRANCH"

  • Setting Build ID and date

    before you start building set the ID by:
    export MOZILLA_OFFICIAL=1
    export BUILD_OFFICIAL=1

    If you use BONE or Dano

    and you haven't done this in your .profile or elsewhere, you need to set these:
    export C_INCLUDE_PATH=/boot/develop/headers/be/bone/
    export CPLUS_INCLUDE_PATH=/boot/develop/headers/be/bone/

    Building Mozilla or Firefox

    Finally it's time to start building Mozilla. This will take a long time since it will download the Mozilla sources needed and then build it. There are other ways of getting the sources that may be faster but this is the way I do it. We are now going to tell make to download and build Mozilla (or Firefox) by using the client.mk file.

    In a Terminal go to your Mozilla folder and type:

    make -f client.mk

    This will start downloading all the sources needed from CVS and then build it. You will see a lot of CVS commands. After that it will run the configure utility, so you should see a lot of options scroll by you in the Terminal window. This is perfectly normal. It also creates the makefiles using your options, into every sub-folder.

    Now it is time to start building. If it runs until it says something about a successful build you managed to build Mozilla (or Firefox) in one go. Congratulations, this is rare.

    Otherwise you've got problems. If the problem seems to occur during the CVS phase re-run the make -f client.mk command above. If it fails during configure something needs fixing that is beyond the scope of this document. Ask for Mozilla builders on BeShare and they will probably help you. We are a great bunch.

    If it fails during building ( it may just be a gcc crash, that happens more than it should ) you can try running this:

    make -f client.mk build

    to restart the building only, Try to see if it goes beyond the place it failed last time. You can also run the make command above but that may take longer time. If it fails again on the same place it's probably an error in the code or left-overs from a gcc-crash.

    Another thing to try is to restart the build from the beginning by removing everything built so far by typing:

    make -f client.mk clean build

    This will take some time though. If you are still stuck see the 'Things to Try on Build Error' section.

  • Trying Out a Successful Build

    Congratulations, you've got a successful build from CVS. You are aching to try it, no? You should probably know that the mozilla/dist directory is where runnable builds and packages you make exists.

    - Go to mozilla/dist in your Terminal.
    - Launch Mozilla like this:

    bin/mozilla

    For Firefox do:

    bin/firefox

    On trunk, if you built the suite, do this:

    bin/seamonkey

    If it works correctly and you think you tested it quite a bit you may want to package it.

    ** Note: The latest updates for BeOS are often not in the CVS so you should not distribute such a package as a new fantastic build. Announce your build on BeShare and someone will probably tell you what to do next. You don't need to be a super dev to do these things but you need to know your ins and outs with Terminals and editing and reporting the right lines to people so they can help you. You probably are though if you decided to do this. **

  • Doing a Mozilla / Firefox package for distribution and client-installation

    Now it's time to package the build for the masses. This is also done from the Terminal being in the mozilla directory.

    Note:If using a defined MOZ_OBJDIR, execute these commands inside your MOZ_OBJDIR

    seamonkey :

        make -C xpinstall/packager

    firefox :

        make -C browser/installer

    thunderbird :

        make -C mail/installer

    sunbird :

        make -C calendar/sunbird/installer

    If it was successful two packages should be waiting for you in the mozilla/dist directory. One for the browser and one for the SDK ( Software Development Kit ). You are probably not interested in the SDK as it's for plugin-developers and such.

    Formats available for packaging include:

    • Zip:
      Easiest to unpack on BeOS. As used above. (DEFAULT)
    • Tar / Gzip:
      Change ZIP in the command above to TGZ.
    • BZip2:
      Change ZIP in the command above to BZ2
  • Other commands available when building

    1. The 'make -f client.mk' Build Script
      The 'make -f client.mk' has some options worth knowing. You add them at the end of the line with a space before and in-between options.

      These are:

      checkout

      Checkout fetches the sources for you so that you can build Mozilla or Firefox. Good if you want to edit the source before building.


      build

      Builds the Mozilla sources. Good if the building crashed and you just want to try to build again.

      clean

      Removes all the temporary files that's created after a build. Don't know if it also cleans the mozilla/dist directory so don't use if you don't wan't to remove everything. Do this if you want to start the building from beginning.

      distclean

      Removes almost everything that's created by the build script above. It's used when you've changed your .mozconfig file and want to prepare for a build with the new configuration. Do a distclean and then a build after you've changed your .mozconfig.
    2. configure
      This command hasn't been discussed before as you shouldn't need to run 'configure' directly. It's located in the mozilla directory and takes care of making sure makefiles exist in all subdirectories. It does this by reading your .mozconfig file and checking what's installed to create the makefiles needed.
    3. make
      Since 'configure', run by you or the 'make -f client.mk'-script above, created makefiles in all directories you can run make directly in most mozilla-directories. This can be used to build only a specific directory if it's hard to build (gcc crashes) or you've modified code in this directory.

      Here are some examples:

      If gcc crashes / building is halted a lot in mozilla/gfx directory (example), go to that dir in Terminal, and run:

      make

      This will build everything in this directory. When successful go to mozilla directory and do the same there for full build.


      If gcc crashes / building is halted a lot in mozilla/gfx directory (example) you can also do a clean build in that dir by typing:

      make clean
      make

      This will first remove all the build files in case any of these were corrupt and then try to build again. When successful go to mozilla directory and do the same there for full build.


      If you changed something in the source in mozilla/gfx directory type:

      make clean
      make

      This assures we remove the old build and build with your changes. As you hopefully had a full and working build before you now have a full build with the change you did. Run it and maybe package it if it's good.


      If you removed the mozilla/gfx directory (example) and replaced it with another copy, type:

      cd [mozilla dir]
      ./config.status
      cd [replaced dir]
      make clean
      make

      The 'config.status'-command will make sure there are correct makefiles in the directory, and build with those. As you hopefully had a full build before you replaced the directory, you now have a full build with the replaced directory. Run it and maybe package it if it's good.

Known Problems and Their Solutions

  1. X11 and BeOS building

    Problem: I havn't gotten configure to ignore X11 if you have that installed. so if configure finds it, it will build for X11 instead of natively for BeOS, which is pretty useless.
    Solution: Uninstall X11. :(
    Or you can just remember to remove the /usr/X11/ directory before building - I have a line in the script I run before building that does just that: "rm /usr/X11/".
    Looks to me like this should be no longer needed, can someone verify? --biesi

  2. libDL

    Configure also detects libdl, and we have our own BeOS native routines to handle that stuff - move libdl out of any main lib directories (/boot/develop/lib/ and /bot/home/config/lib/) before building. If you have any other programs that require libdl, you can put a symlink to it in the folder "/app-that-needs-libdl-folder/lib/".
    Not needed on trunk (Gecko 1.9) anymore, now that bug 321230 is fixed

Changes made:

Change control ( add a line if you change something so people know if build-instructions changed ):
2009-May-13 Mirrored BeOS's toolchain at http://bezilla.beuser.de --mmadia
2008-Jun-21 Changed sample .mozconfig to pull from 1.8 branch. Cleaned up a few minor grammatical error --tigerdog
2008-Mar-03 Added more information on checking out 1.8branch code, added package command for Sunbird --mmadia
2007-Oct-17 Added note about not being able to build trunk under BeOS after 2007-02-06 --tigerdog
2006-Feb-24 Modified sample .mozconfig to disable SVG and canvas support until Cairo support is documented --tigerdog
2005-Dec-22 Note bug number for making configure not detect libdl
2005-Nov-5 Made the note about adding a change-line more obvious as it seems someone forgets!
2005-Oct-10 Cleaned up mozconfig -biesi
2005-Aug-18 Added glib+libIDL note, Updated .mozconfig and checkout instructions --z_eight_a
2005-Jul-18 Zeta 1.0 + mozconfig cleanup. Also fixing package creation instructions for Firefox.
2005-Jul-07 Notes on BONE
2005-Jan-09 Firefox builds from the trunk as well
2004-Dec-27 Added notes for using Oliver Tappe's gcc --mmadia
2004-Apr-10 Updated Firefox infos --Franxico
2004-Febr-6 Setting build ID and date
2004-Jan-26 Additional note about 'glib' and 'libIDL' buildscript. -Decaf
2004-Jan-03 Cleaned up html and other stylistic refinements. --Chris Simmons
2004-Jan-02 Updated .mozconfig and other small changes.
2003-June-16 I don't think I'll do any more changes on this, maybe just some update if I discover something new. Go ahead and add stuff. It also seems that you need to do something extra on Zeta to get it to build. I'll leave that to people who have Zeta to figure it out. Doesn't seem that it is a tough problem though.
2003-May-24 First version, written by Decaf ( + some thing from older building instructions )

Links


PAGE VISITS
25,135

LINKS HERE
CrosscompilingFirefox
TableOfContents
HowTo

NEW PAGES
CrosscompilingFirefox
BuildingCairo
StoringDataInBetweenOSes
ScriptingBeosRuby
ScriptingBeosPython
HaikuOS
QemUwinbe
MinimalBeos
XpMBRoverwrite
SteveSakoman

RECENT CHANGES
CorumIII
BeUserProfiles
PhilipDybowski
BuildingFirebird
FrontPage
BeAcademic
CrosscompilingFirefox
HowTo
BuildingCairo
BeCommunity
Edit Page | Front Page | BeBits
Site content is in the public domain. Unless otherwise noted, everything else is copyright © 1999-2002 Fifth Ace Productions, LLC. All Rights Reserved.
For more legal trivia, take a gander at our
Legal Stuff page and our Privacy Statement.
Fifth Ace Productions