Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Required Software

OpenSolaris (and therefore also Solaris 11) can build Mozilla with a few extra packages installed:

  • OpenSolaris builds before snv_133:
$ pfexec pkg install SUNWhea SUNWmercurial SUNWaudh SUNWxwinc SUNWxorg-headers SUNWgm4 SUNWgnome-common-devel SUNWcvs SUNWgmake sunstudio
  • OpenSolaris builds since snv_133:
$ pfexec pkg install x11/header mercurial header-audio x11/header header-xorg gnu-m4 gnome/gettext cvs gnu-make sunstudio

  • gcc or gcc-43 is required to build js-ctypes
  • autoconf 2.13 is necessary if you get source code from hg repo. Download the source tarball, untar it, ./configure --program-suffix=-2.13; gmake; pfexec gmake install. Autoconf 2.5x will not work. See bug 104642 for details. 

Build Environment

Get source code from hg repo or source tarball.

Sun Studio 12.1 is recommended for building Mozilla project (however there're some bugs you need workarounds).
Sun Studio 12 or gcc-43 is usable but you need some patches.

Set the environment variables as follows:

export PATH=$PATH:/opt/sunstudio12.1/bin:{gcc PATH}:{autoconf-2.13 PATH}
export CC=cc
export CXX=CC

You can use a typical .mozconfig file. For current HEAD these mozconfigs are recommended:

For Firefox debug build:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-debug
ac_add_options --enable-application=browser
ac_add_options --enable-tests
ac_add_options --disable-jemalloc
ac_add_options --enable-dtrace
ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --disable-ipc
ac_add_options --disable-libxul
ac_add_options --disable-crashreporter
For Firefox release build:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-release
ac_add_options --enable-application=browser
ac_add_options --enable-tests
ac_add_options --disable-jemalloc
ac_add_options --enable-dtrace
ac_add_options --disable-debug
ac_add_options --enable-optimize
ac_add_options --disable-ipc
ac_add_options --disable-crashreporter
For Thunderbird debug build:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-debug
ac_add_options --enable-application=mail
ac_add_options --enable-calendar
ac_add_options --enable-tests
ac_add_options --disable-jemalloc
ac_add_options --enable-dtrace
ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --disable-ipc
ac_add_options --disable-libxul
ac_add_options --enable-shared
ac_add_options --disable-static
ac_add_options --disable-crashreporter
For Thunderbird release build:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-release
ac_add_options --enable-application=mail
ac_add_options --enable-calendar
ac_add_options --enable-tests
ac_add_options --disable-jemalloc
ac_add_options --enable-dtrace
ac_add_options --disable-debug
ac_add_options --enable-optimize
ac_add_options --disable-ipc
ac_add_options --disable-shared
ac_add_options --enable-static
ac_add_options --disable-crashreporter

 Then run gmake -f client.mk to start to build.

Note that the standard Solaris make tool doesn't work. Use gmake instead. (For OpenSolaris, /usr/gnu/bin/make is gmake.)

Patches

See attached files for patches needed to build with Sun Studio 12.1.

You will also need to verify that python/mozbuild/mozbuild/mozconfig_loader is a /bin/bash script, not /bin/sh. Make it /bin/bash, if it isnt already.
Otherwise, you may see errors such as,"mozconfig_loader[57]: .[39]: local: not found [No such file or directory]"

Troubleshooting

  • You'll get an error if you use make instead of gmake.
$ make -f client.mk build
make: Fatal error in reader: client.mk, line 126: Unexpected end of line seen

$ gmake -f client.mk build
(this one works!)
  • If the build fails due to missing Makefile.in files check that you unpacked the archive with gtar (/usr/sfw/bin/gtar on Solaris 10) rather than the Solaris tar command.
  • If configure complains about your compiler, ensure you set CC and CXX correctly.
  • If you met a crash when start/close your build of Firefox/Thunderbird with MOZ_gdk_display_close in core stack, you hit defect 12024 . Set GTK_IM_MODULE=xim to get around.
  • If you want to remote display from SPARC to x86 or x86 to SPARC, please apply the patch in Bug 526977.
  • If configure tells you the x11 package is missing, save the following text to /usr/lib/pkgconfig/x11.pc (Sun bug 6571762). Alternatively, you can create x11.pc in an arbitrary location and set the PKG_CONFIG_PATH environment variable to the directory containing it.
prefix=/usr/openwin
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

xthreadlib=

Name: X11
Description: X Library
Version: 0.0
Requires: xproto kbproto inputproto
Requires.private: xau xdmcp
Cflags: -I${includedir} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DXTHREADS -DXUSE_MTSAFE_API
Libs: -L${libdir} -R${libdir} -lX11
Libs.private:
  • If you're building on OpenSolaris 2008.05, and configure tells you the xrandr package is missing, save the following text to /usr/lib/pkgconfig/xrandr.pc . Alternatively, you can create xrandr.pc in an arbitrary location and set the PKG_CONFIG_PATH environment variable to the directory containing it.
prefix=/usr/X11
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Xrandr
Description: X Randr Library
Version: 0.9.4
Requires: xproto renderproto >= 0.9 x11

Cflags: -I${includedir}
Libs: -L${libdir} -R${libdir} -lXrandr
  • If you're building Firefox 2, and mkdepend takes forever on nsIconChannel.cpp, disable automatic dependencies in your mozconfig file to work around bug 296653 (which is fixed on the trunk but not on the branch):
ac_add_options --disable-auto-deps
  • If you're building on a recent development version of OpenSolaris (snv_130 - snv_132, possibly prior) with the included SunStudio compiler, you may see the a C++ compiler error when running 'gmake -f client.mk build'.  This can be worked around by setting the C++ compiler flags:
export CXXFLAGS="-xannotate=no"

Document Tags and Contributors

 Last updated by: ppbrown,