Building the viewer libraries (Linux)
This page is referred to by Compiling the viewer (Linux), and contains instructions for building the libraries used by the Second Life viewer from original source. You may wish to do this if you are porting to a new architecture or wish to make a package tailored to your Linux distribution's own libraries. You will have to install the following additional dependencies listed below. Paths and package names given here are based on Ubuntu 7.04 and may vary according to your Linux distribution.
List of libraries
- apr-1 [ubuntu: libapr1-dev, fedora: apr-devel]
- aprutil-1 [ubuntu: libaprutil1-dev, fedora: apr-util-devel]
- boost [ubuntu: libboost-dev, fedora: boost-devel]
- boost-regex [ubuntu: libboost-regex-dev]
- curl library at least version 7.15.4 is recommended, 7.16.x is ideal.
- [ubuntu: libcurl3-dev, fedora: libcurl-devel]
- If you are compiling your own version of Curl, then you should consider configuring it to use the c-ares library so that DNS lookups will be asynchronous.
- c-ares library (mandatory for v1.18.4.0, and missing from the pre-compiled libraries package):
- <http://daniel.haxx.se/projects/c-ares/>
- [fedora: c-ares-devel]
- [ubuntu (gutsy): download Hardy packages and install:
% sudo dpkg -i libc-ares1 && dpkg -i libc-ares-dev
- ELFIO <http://sourceforge.net/projects/elfio/>
- This wants to build a static library by default. Afterwards, to create a dynamic libelfio.so
% cd ELFIO && g++-3.4 -shared *.o -o libELFIO.so
- expat [ubuntu: libexpat1-dev, ubuntu (gutsy): libcurl4-openssl-dev, fedora: expat-devel]
- google-perftools library for the tcmalloc and stacktrace libraries. (memory checking)
- [ubuntu: libgoogle-perftools-dev, fedora: google-perftools-devel.i386
- GTK 2.x development headers [ubuntu: libgtk2.0-dev, fedora: gtk2-devel]
- jpeglib [ubuntu: libjpeg62-dev, fedora: libjpeg-devel]
- OpenJPEG <http://www.openjpeg.org/>
- note: OpenJPEG 1.1.1 or greater is required which has the macro OPJ_PATH_LEN, if the header has MAX_PATH, then upgrade or it will crash with a divide by zero error as the structures would be two different sizes.
- what does this mean?
- note: OpenJPEG 1.1.1 or greater is required which has the macro OPJ_PATH_LEN, if the header has MAX_PATH, then upgrade or it will crash with a divide by zero error as the structures would be two different sizes.
- OpenSSL <http://www.openssl.org/> [ubuntu: libssl-dev, fedora: openssl-devel]
- SDL [ubuntu libsdl1.2-dev, fedora: SDL-devel]
- Vorbis [ubuntu: libvorbis-dev, fedora: libvorbis-devel]
- xmlrpc-epi 0.54 <http://xmlrpc-epi.sourceforge.net/>
- note: not xmlrpc-c (xmlrpc-c has a library and headers with the same name but is not compatible)
Copy headers and libraries into the source tree
Here is a guide to the sequence of shell commands needed to copy the required headers and libraries into the Second Life Viewer source tree for building. Actual paths to system headers may vary according to Linux distribution.
If you are using the easy slviewer-linux-libs bundle then you can skip the rest of this section, otherwise you will also need to perform the following:
- ${SLSRC} refers to the top-level directory of the Second Life Viewer source tree.
- ${OPENJPEG} refers to the top-level directory of your completed OpenJPEG build.
- ${ELFIO} refers to the top-level directory of your completed ELFIO build.
cp -a /usr/include/atk-1.0 ${SLSRC}/libraries/i686-linux/include/
cp -a /usr/include/gtk-2.0 ${SLSRC}/libraries/i686-linux/include/
cp -a /usr/lib/gtk-2.0/include/* ${SLSRC}/libraries/i686-linux/include/gtk-2.0/
cp -a /usr/include/glib-2.0 ${SLSRC}/libraries/i686-linux/include/
cp -a /usr/lib/glib-2.0/include/* ${SLSRC}/libraries/i686-linux/include/glib-2.0/
cp -a /usr/include/pango-1.0 ${SLSRC}/libraries/i686-linux/include/
if your GTK is fairly recent and thus needs Cairo:
cp -a /usr/include/cairo/* ${SLSRC}/libraries/i686-linux/include
cp -a /usr/include/apr-1.0/ ${SLSRC}/libraries/i686-linux/include/apr-1
mkdir ${SLSRC}/libraries/i686-linux/include/expat
cp -a /usr/include/expat*.h ${SLSRC}/libraries/i686-linux/include/expat/
mkdir ${SLSRC}/libraries/i686-linux/include/zlib
cp -a /usr/include/zlib*.h ${SLSRC}/libraries/i686-linux/include/zlib/
mkdir ${SLSRC}/libraries/i686-linux/include/openjpeg
cp ${OPENJPEG}/libopenjpeg/openjpeg.h ${SLSRC}/libraries/i686-linux/include/openjpeg/
cp ${OPENJPEG}/libopenjpeg.a ${SLSRC}/libraries/i686-linux/lib_release_client/
mkdir ${SLSRC}/libraries/i686-linux/include/ELFIO
cp ${ELFIO}/ELFIO/*.h ${SLSRC}/libraries/i686-linux/include/ELFIO/
cp ${ELFIO}/ELFIO/libelfio.so ${SLSRC}/libraries/i686-linux/lib_release_client/
mkdir ${SLSRC}/libraries/i686-linux/include/jpeglib
cp -a /usr/include/j*.h ${SLSRC}/libraries/i686-linux/include/jpeglib/
touch ${SLSRC}/libraries/i686-linux/include/jpeglib/jinclude.h
mkdir ${SLSRC}/libraries/i686-linux/include/llfreetype2
cp -a /usr/include/freetype2/freetype/ ${SLSRC}/libraries/i686-linux/include/llfreetype2/
cp -a /usr/include/ft2build.h ${SLSRC}/libraries/i686-linux/include/llfreetype2/freetype/
mkdir ${SLSRC}/libraries/i686-linux/include/xmlrpc-epi
cp -a /usr/include/xmlrpc*.h ${SLSRC}/libraries/i686-linux/include/xmlrpc-epi/
# For SL v1.18.4.0:
mkdir ${SLSRC}/libraries/i686-linux/include/ares
cp -a /usr/include/ares* ${SLSRC}/libraries/i686-linux/include/ares/
cp -a /usr/lib/libcares.* ${SLSRC}/libraries/i686-linux/lib_release_client/
Return to Compiling the viewer (Linux)