Visit Mozilla.org

Compiling 32-bit Firefox on a Linux 64-bit OS

From MDC

The following commands are a recipe bsmedberg uses to compile 32-bit Firefox on an x86-64 Fedora Core 7 system. This is not technically cross-compiling, because the "target" binaries being produced will run on the native system; this means that a lot of the complexities of cross-compiling can be avoided.

[edit] Packages

The following extra packages must be installed (using sudo yum install packagename):

  • libXi-devel.i386
  • cairo-devel.i386
  • xorg-x11-proto-devel.i386
  • fontconfig-devel.i386 - Unfortunately, yum refuses to install this package at the same time as fontconfig-devel.x86_64 - I had to download the RPM and install it manually using rpm -i --replacefiles fontconfig-devel-2.4.2-3.fc7.i386.rpm
  • libIDL-devel.i386

The list of additional packages given above requires modifications for Fedora 8:

  • xorg-x11-proto-devel.i386 is no longer present in Fedora 8. The .noarch RPM package is used instead, and it should have been automatically installed. This RPM package (xorg-x11-proto-devel.noarch) has pkg-config files in a different location (/usr/share/pkgconfig).
  • popt-devel.386 - Unfortunately, yum refuses to install this package at the same time as popt-devel.x86_64 - I had to download the RPM and install it manually using rpm -i --replacefiles popt-devel-1.12-3.fc8.i386.rpm
  • dbus-glib-devel.i386 may also need to be installed

[edit] Configuration

To configure by hand in a bash-like shell, use the following command:

PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CC="gcc -m32" CXX="g++ -m32" ../mozilla/configure --x-libraries=/usr/lib --target=i686-pc-linux --other-options-here

To do the same thing with a mozconfig file:

export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig
CC="gcc -m32"
CXX="g++ -m32"
ac_add_options --x-libraries=/usr/lib
ac_add_options --target=i686-pc-linux

For Fedora 8 it is necessary to add /usr/share/pkgconfig to PKG_CONFIG_LIBDIR:

export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig

[edit] See Also