Difference between revisions of "Build the Viewer on Linux"

From Second Life Wiki
Jump to navigation Jump to search
(More clarification and reformatting.)
(More clarification and reformatting.)
Line 5: Line 5:
Paths and package names given here are based on Ubuntu 6.06 and may vary according to your Linux distribution.
Paths and package names given here are based on Ubuntu 6.06 and may vary according to your Linux distribution.


=== Packages to install before you begin ===
=== Prerequisites ===


* install scons [scons]
* You will need the <b>SCons</b> build tool [package: scons] and the <b>GCC 3.4</b> C/C++ compiler [package: g++-3.4]; other GCC versions are not well-tested.
* install boost [libboost-dev]
 
* install boost-regex [libboost-regex-dev]
* install <b>boost</b> [libboost-dev]
* install apr-1 [libapr1.0-dev]
* install <b>boost-regex</b> [libboost-regex-dev]
* install aprutil-1 [libaprutil1.0-dev]
* install <b>apr-1</b> [libapr1.0-dev]
* install xmlrpc-epi 0.51 <http://xmlrpc-epi.sourceforge.net/>
* install <b>aprutil-1</b> [libaprutil1.0-dev]
* install <b>xmlrpc-epi 0.51</b> <http://xmlrpc-epi.sourceforge.net/>
** note: not xmlrpc-c (xmlrpc-c has a library and headers with the same name but is not compatible)
** note: not xmlrpc-c (xmlrpc-c has a library and headers with the same name but is not compatible)
* install jpeglib [libjpeg62-dev]
* install <b>jpeglib</b> [libjpeg62-dev]
* install SDL [libsdl1.2-dev]
* install <b>SDL</b> [libsdl1.2-dev]
* install Vorbis [libvorbis-dev]
* install <b>Vorbis</b> [libvorbis-dev]
* install libgtk2 [libgtk2.0-dev]
* install <b>GTK 2.x</b> [libgtk2.0-dev]
* unpack FMOD 3 <http://www.fmod.org/>
* unpack <b>FMOD 3.75</b> <http://www.fmod.org/>
* build ELFIO <http://sourceforge.net/projects/elfio/>
* build <b>ELFIO</b> <http://sourceforge.net/projects/elfio/>
* build OpenJPEG <http://www.openjpeg.org/>
* build <b>OpenJPEG</b> <http://www.openjpeg.org/>


=== Copy headers and libraries into the source tree ===
=== Copy headers and libraries into the source tree ===

Revision as of 05:44, 20 December 2006

Installing the required dependancies

Paths and package names given here are based on Ubuntu 6.06 and may vary according to your Linux distribution.

Prerequisites

  • You will need the SCons build tool [package: scons] and the GCC 3.4 C/C++ compiler [package: g++-3.4]; other GCC versions are not well-tested.

Copy headers and libraries into the source tree

Here is a guide to the sequence of shell commands needed to copy the needed headers and libraries into the Second Life Viewer source tree for building. Actual paths to system headers may vary according to Linux distribution.

  • ${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.
  • ${FMOD} refers to the top-level directory into which you unpacked FMOD 3.
  • ${ELFIO} refers to the top-level directory of your completed ELFIO build.

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/
cp ${FMOD}/api/inc/* ${SLSRC}/libraries/i686-linux/include/
cp ${FMOD}/api/libfmod-3.75.so ${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/
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/

Compiling

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

  • resulting unstripped binary is then newview/secondlife-i686-bin

Running from inside the tree

  • preparing to run 'in-tree'
    • ensure you have indra/newview/app_settings/static_*.db2 - if not, you'll find it in the 'binary-common' package.

$ cp ../../scripts/messages/message_template.msg app_settings/

  • running it!

$ ( cd newview && LD_LIBRARY_PATH=../../libraries/i686-linux/lib_release_client:${LD_LIBRARY_PATH}:/usr/local/lib  ./secondlife-i686-bin )

Packaging the client

This doesn't work 'out of the box' as an automated process right now.