Difference between revisions of "User:Dzonatas Sol/Compiling The Viewer"

From Second Life Wiki
Jump to navigation Jump to search
(→‎Microsoft Windows: updated link to MSVS page)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
Ideally, we need the builder to be very portable and to give the exact same results on every build. The SConstruct file as it has existed has been mainly for a Linux specific build. There are additional files, found in OSLCC, that can be used to make this work on Win32 environments.
Ideally, we need the builder to be very portable and to give the exact same results on every build. The SConstruct file as it has existed has been mainly for a Linux specific build. There are additional files, found in OSLCC, that can be used to make this work on Win32 environments.


There are two main ways to build the viewer, and that is with or without the pre-built libraries. The SCons script can compile the libraries, but that is not recommended for those that only want to compile and test the viewer.
There are two main ways to build the viewer, and that is with or without the pre-built libraries. The SCons script can compile the libraries, but that is not recommended for those that only want to compile and test the viewer. If you start to distribute your built viewer or use custom libraries, you will want to compile the libraries to ensure compliance with ABIs and licenses.


== Prerequisites ==
== Prerequisites ==
Line 11: Line 11:
=== Microsoft Windows ===
=== Microsoft Windows ===
If you don't already have these, then install:
If you don't already have these, then install:
* Visual Studio 2005 SP1 '''''-or-''''' [http://msdn.microsoft.com/vstudio/express/visualc/download/ Visual C++ 2005 Express SP1]<small>(Free)</small>
* [[User:Dzonatas Sol/Microsoft Visual Studio|Microsoft Visual Studio, MS Platform SDK & DirectX SDK]]
* [http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Microsoft Platform SDK]
* [http://download.microsoft.com/download/5/1/f/51ff8357-0af3-418b-9d0b-e9a5cdc39759/dxsdk_dec2006.EXE DirectX 9.0 SDK (December 2006)]
* [http://cygwin.com Cygwin - install the base as well as bison, flex, perl, gzip, tar, unzip, wget, and subversion]
* [http://cygwin.com Cygwin - install the base as well as bison, flex, perl, gzip, tar, unzip, wget, and subversion]
* [http://python.org/download Python 2.5]
* [http://python.org/download Python 2.5]
* [http://www.scons.org SCons]
* [http://www.scons.org SCons]
* [[Compiling_the_viewer_%28MSVS2005%29#OpenGL|OpenGL]] (add to workspace created below)
* [[Compiling_the_viewer_%28MSVS2005%29#OpenGL|OpenGL]]
* [[Compiling_the_viewer_%28MSVS2005%29#Fmod|FMOD]] (add to workspace created below)
* [[Compiling_the_viewer_%28MSVS2005%29#Fmod|FMOD]]
* [[Compiling_the_viewer_%28MSVS2005%29#Quicktime_.28optional.29|Quicktime]]
* [[Compiling_the_viewer_%28MSVS2005%29#Quicktime_.28optional.29|Quicktime]]


You may want to put OpenGL, FMOD, and Quicktime in a separate tree and copy them over as described [[Compiling_the_viewer_%28MSVS2005%29#Proprietary_Libraries|here]].
NOTE: You may want to put OpenGL, FMOD, and Quicktime in a separate tree and copy them over as described [[Compiling_the_viewer_%28MSVS2005%29#Proprietary_Libraries|here]].


The Cygwin installer is different from most installers in that it allows you to install many  tools in addition to the base installation.  You select the packages you want by clicking on the funny double arrow icons for the packages you want.  Ordinarily, you only need the binaries, not the source.  You can install more packages at a later time or update the packages you have by running the setup.exe program again, so keep it around.  It is best to use the same download site every time.
The Cygwin installer is different from most installers in that it allows you to install many  tools in addition to the base installation.  You select the packages you want by clicking on the funny double arrow icons for the packages you want.  Ordinarily, you only need the binaries, not the source.  You can install more packages at a later time or update the packages you have by running the setup.exe program again, so keep it around.  It is best to use the same download site every time.

Latest revision as of 09:43, 22 December 2007

Overview

SCons and CMake together can make a very powerful builder and development environment utilities. They both have unique features that we need. This document focuses mainly on SCons to just get the viewer built.

Ideally, we need the builder to be very portable and to give the exact same results on every build. The SConstruct file as it has existed has been mainly for a Linux specific build. There are additional files, found in OSLCC, that can be used to make this work on Win32 environments.

There are two main ways to build the viewer, and that is with or without the pre-built libraries. The SCons script can compile the libraries, but that is not recommended for those that only want to compile and test the viewer. If you start to distribute your built viewer or use custom libraries, you will want to compile the libraries to ensure compliance with ABIs and licenses.

Prerequisites

Microsoft Windows

If you don't already have these, then install:

NOTE: You may want to put OpenGL, FMOD, and Quicktime in a separate tree and copy them over as described here.

The Cygwin installer is different from most installers in that it allows you to install many tools in addition to the base installation. You select the packages you want by clicking on the funny double arrow icons for the packages you want. Ordinarily, you only need the binaries, not the source. You can install more packages at a later time or update the packages you have by running the setup.exe program again, so keep it around. It is best to use the same download site every time.

In order for Cygwin and Python to be accessed without having to specify their full paths, add them to the "Path" environment variable. Go to

Control Panel -> System -> Advanced -> Environment Variables

and add ;c:\cygwin\bin;c:\Python25 to the System variable "Path"

Get the source

Create your preferred workspace and use subversion to retrieve the source:

 > md workspace
 > cd workspace
 > svn co http://oslcc.svn.sourceforge.net/svnroot/oslcc/sandbox/branches/llscons/1.18.6 linden

The SCons control files

  • indra\SConstruct - this files replaces the SConstruct file that comes with the Linden distributions
  • indra\llscons\msvc.sconscript - this defines the compile and link flags and defines the path for libraries and header files
  • indra\llscons\win32.sconscript - this defines the build paths
  • indra\llscons\win32\libs.files.lst - a list of libraries to use
  • indra\llscons\win32\newview.sconscript - build instructions for the viewer

If you want to build a version that is not in the oslcc repository, you can get these five files, put them in the appropriate places in your build tree, and edit them as necessary.

Install the pre-built libraries

This step will be automated, but this is an example of how to install them.

Install the libraries into the workspace:

 > cd workspace
 > wget http://secondlife.com/developers/opensource/downloads/2007/12/slviewer-win32-libs-RC-1.18.6.0.zip
 > unzip slviewer-win32-libs-RC-1.18.6.0.zip

If you do not have 'wget' or 'unzip', you can use your web browser to download the libs from Source downloads and then use windows directory explorer to open the zip files. Once opened, copy and paste the linden folder into your workspace. (Reply 'yes' if it asks you to overwrite files.)

If you haven't already, make sure FMOD, OpenGL headers, and Quicktime are install at this time.

Compile

By default, the scripts assume you have the pre-built libraries installed in your workspace.

To compile, just run scons:

> cd workspace\linden\indra
> scons

If there are no errors reported from that step, you will have a full build of the viewer.

Libraries

  • TODO: update to compile with all library sources