Building Firefox/Thunderbird on Ubuntu PPC (Linux/PowerPC)
I have this not-so-shiny 12" PowerBook G4 that I haven't touched in a while: my job calls for me to develop/test Orca on Solaris and Linux. As such, I pound away each day on three machines:
- A dual-CPU (Opteron) Sun box - it typically is up-to-date within a week or so of the latest Solaris Express release.
- A dual-CPU (SPARC) SunBlade 2000 - I think I inherited from Marc Mulcahy, who wrote the proof-of-concept for Orca.
- A Toshiba Tecra M2 Laptop that usually has the latest flavor of Ubuntu on it.
My PowerBook G4 has been sitting there all lonely and not getting any attention. It's battery life is longer than the Tecra. It is smaller and weighs less as well. I thought to myself "what if I put Solaris on the Tecra and Ubuntu on the PowerBook?" So, I backed up the PowerBook, blew away the OS on the drive, and put Ubuntu Edgy on it (Feisty still has issues with the Broadcom wireless card support). Piece of cake, even if I kind of ended up with a dancing bear of a machine.
I then set out to see if I could actually do my job on the machine. Almost everything seemed pretty cool, except for one thing: where do I get Linux/PowerPC nightly builds of Firefox, Thunderbird, and OpenOffice? I learned that I needed to build Firefox and Thunderbird from CVS myself since the Mozilla folks don't provide nightly builds on Linux/PowerPC. I don't know the answer to the OOo question yet.
The first thing I needed to do to build Firefox/Thunderbird from Mozilla CVS was write a patch for Mozilla bug 349002. To do that, I needed to learn how to build Firefox/Thunderbird from Mozilla's CVS repository. I started with Firefox. It was this easy for me, especially with the guiding hand of seasoned Mozilla developers:
sudo apt-get build-dep firefox cat > ~/.mozconfig << EOF . $topsrcdir/browser/config/mozconfig ac_add_options --disable-optimize ac_add_options --enable-debug ac_add_options --disable-tests ac_add_options --enable-extensions=default EOF cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk mozilla/browser/config/mozconfig cd mozilla make -f client.mk checkout make -f client.mk build ...WAIT A FEW HOURS WHILE THE BUILD CHUGS AWAY... ./dist/firefox&
The hard part is the ~/.mozconfig part. The Firefox build fails "out of the box", due to the reasons outlined in Mozilla bug 26323. The failure I saw was:
undefined reference to `nsCOMPtr_base::~nsCOMPtr_base()'
I think the "--enable-debug" and "--disable-tests" lines are the key lines to prevent this behavior.
If you like pressing lots of buttons, turning lots of dials, and throwing numerous switches with unfamiliar names, you can also play with the Mozilla Build Configurator available from Mozilla Configuring Build Options. I should move to Missouri, the "Show Me State", because I didn't have a clue about what was important and what wasn't.
For Thunderbird, I'm assuming substituting "mail" for "browser" and repeating the above steps should work. Given that the build takes a few hours on my little PowerPC, I thought I'd try to have the Firefox and Thunderbird builds share common files. Here's what I tried for the "both in one" approach:
sudo apt-get build-dep firefox cat > ~/.mozconfig << EOF mk_add_options MOZ_CO_PROJECT=browser,mail ac_add_options --enable-application=browser ac_add_options --enable-application=mail ac_add_options --disable-optimize ac_add_options --enable-debug ac_add_options --disable-tests ac_add_options --enable-extensions=default EOF cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk cd mozilla make -f client.mk checkout make -f client.mk build ...WAIT A FEW HOURS WHILE THE BUILD CHUGS AWAY... ./dist/firefox& ./dist/thunderbird&
It didn't seem to work. Running ./dist/thunderbird brought up Firefox with a mail icon. Odd. I guess I blended the two in the wrong way.