Solaris Build Prerequisites
From MDC
Contents |
[edit] Required Software
Solaris Express Developer Edition (SXDE) 9/07 includes almost everything you need. If you're running an older version of Solaris, you may need to install or patch Sun Studio (compilers and tools).
- Sun Studio 12 works, as of SXDE 9/07. Problems have been reported with earlier Sun Studio 12 releases (eg Sun bug 6599134). If you encounter problems with an older release, check for patches or install Sun Studio 11.
- Sun Studio 11 works, but 2 patches are required (120759 and 121016).
CVS isn't shipped with Solaris or Sun Studio. You can easily install it from BlastWave. As root run:
# pkgadd -d http://www.blastwave.org/pkg_get.pkg # pkg-get install cvs
Software from BlastWave is installed under /opt/csw/, so include /opt/csw/bin in your PATH.
[edit] Optional Software
- autoconf 2.13 is necessary if you want to hack on configure.in (f.e. because you are patching Mozilla to use dtrace). If you have no idea what this means, then don't worry about it. It's optional. Autoconf 2.5x will not work. See bug 104642 for details.
- JDS Common Build Environment (CBE). Provides build tools needed by some open-source projects (eg Gnome). The tools included with Solaris and Sun Studio should be sufficient for building Mozilla, so you can skip this.
- The installer must install additional Sun-provided packages from the OS install DVD, so that DVD has to be available.
- The installer will try to install the SUNWsmbaS package, which is not available in newer versions of SXDE. Fortunately, it also isn't necessary, so you can fix this problem by simply removing the reference to that package from the installer script (cbe-install).
- The installer may tell you your C compiler is not the recommended compiler, but the compiler you installed will work fine, so you should tell the installer to use the compiler anyway.
- Run
. /opt/jdsbld/bin/env.shto import the JDS CBE settings into your environment.
[edit] Build Environment
Set the following environment variables.
export CC=/opt/SUNWspro/bin/cc export CXX=/opt/SUNWspro/bin/CC export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"
You can use a typical .mozconfig file. For example:
. $topsrcdir/browser/config/mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff ac_add_options --disable-libxul ac_add_options --enable-debug --disable-optimize ac_add_options --enable-shared --disable-static
Note that the standard Solaris make tool doesn't work. Use gmake instead.
[edit] Troubleshooting
- You'll get an error if you use
makeinstead ofgmake.
$ 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 configure complains about your compiler, ensure you set CC and CXX correctly. If the build runs for a bit and then fails when linking Freetype (-lfreetype), ensure you set LDFLAGS correctly.
- Sun Studio 12 may appear to hang when building dependancies for
jsdtracef.c. It's just slow -- on a 2.4Ghz box it takes almost an hour (!) to complete this step. Wait it out, or downgrade to Sun Studio 11 + patches. Incremental builds are fast, unless that source file is modified.
- If the build hangs when compiling
jsinterp.c, you need the Sun Studio 11 patches mentioned above.
- 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 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