Compiling the viewer with SCons (Linux)

From Second Life Wiki
Jump to navigation Jump to search

This page is referred to by Compiling the viewer (Linux), and contains instructions for building the viewer using SCons.


These instructions will only work for older viewers (1.20 and earlier). For 1.21 and newer, use CMake

Build Types

The BUILD parameter specifies the build type. For normal usage, use release. If you plan to work on the source, choose releasenoopt or debug, as these versions are unoptimized and much easier to debug.

You can also edit the scons file to cause releasefordownload to skip the "stripping" step, for a version that is relatively easy to debug, yet still performs well.

  • release: Optimized build for release.
  • releasenoopt: Unoptimized build.
  • debug: Debug build with assertions.
  • releasefordownload: Optimized build for release, will create a .tar.gz with the files for distribution.


Enabling llMozLib

Add MOZLIB=yes to your Scons build command when compiling the source. Failure to do this will cause errors on some versions, due to badly structured ifdefs in the code. If you really don't want mozlib you must apply the patches attached to VWR-3748.

$ cd indra
$ scons DISTCC=no BTARGET=client BUILD=release MOZLIB=yes

Expect a build time of a couple of hours. The resulting unstripped Second Life Viewer binary is newview/secondlife-i686-bin. Note that temporary object code is compiled into /tmp/$USER by default (where $USER is your username) - this can be changed by prefixing the scons command above with TEMP_BUILD_DIR="[full directory path]". For example:

$ TEMP_BUILD_DIR="/home/fred/secondlife/temp-build" scons DISTCC=no BTARGET=client BUILD=release

To build a release that has all of the shaders and optimizations enabled and resembles the official shipped Linux client, use BUILD=releasefordownload

Be sure to read the Common compilation problems page if you have problems - we'll try to keep the page up to date with known problems and solutions.

Return to Compiling the viewer (Linux)