Difference between revisions of "Compiling the viewer (Mac OS X)"

From Second Life Wiki
Jump to navigation Jump to search
m (adding links to barney's tips)
(Added a Languages mark.)
Line 1: Line 1:
{{Multi-lang}}
{{CompileNav}}
{{CompileNav}}



Revision as of 08:09, 4 November 2007

The following are instructions for building the Second Life viewer on Mac OS X. For other platforms, see Compiling the viewer

You will also need to check the Build Notes column of the table on source downloads page.

Development Environment

Lindens use XCode 2.4.1 for building on Macintosh computers. For simplicity, we suggest installing everything from the mpkg.

You will need to install the proprietary libraries as well as all of the other third party libraries below.

Installing Files

Viewer Source, Libraries, and Artwork

The required source code, pre-compiled third-party libraries, and artwork files are available from the source downloads page. Download the Mac/Linux (LF) source, the Mac library package, and the Artwork zip file.

Unpack them into a single directory. The directory that you work in should should have no spaces in the name. For example, from the directory where you downloaded the tarballs (x.x.x.x = version number, e.g., 1.14.0.1.):

$ tar xvfz slviewer-src-x.x.x.x.tar.gz
$ tar xvfz slviewer-darwin-libs-x.x.x.x.tar.gz
$ unzip slviewer-artwork-x.x.x.x.zip

If you have Stuffit installed on your system, it may automacially unstuff .gz, so use tar xvf, without the z to extract the tar file. It may also automatically unzip files. Instead of clicking on the file link, right click on the file link and select Download Linked File which will keep .gz and .zip intact.

The exact filenames will differ with the version number. If you open them with the double click file extract, remember that dragging folders on top of each other will overwrite the original contents, not merge them as in Windows.

Check the source downloads page for any special Build Notes associated with the viewer version, if any.

Installing Libraries From Scratch (Optional)

For convenience, Lindens package up the libraries they are allowed to distribute so you can download and unpack them into your development working directory. The above procedure installs pre-compiled third-party library files. Alternatively, if you want to build the libraries yourself, See another page.

Installing Proprietary Libraries

The Viewer depends on some proprietary libraries. Lindens do not distribute these libraries, so you will need to fetch and install these even if you download the libraries packages. (This is due to licensing restrictions. Don't ask, Lindens already did, and can't get permission. So you do have to get them yourself.)

Fmod

  • Download & extract fmod 3.75 programmers api for macintosh.
  • (You do *not* want the latest version, instead scroll down to v3.75)
  • Copy the extracted files. Note the name change for the x86 library.
$ cp -p fmodapi375mac/api/inc/*.h linden/libraries/include
$ cp -p fmodapi375mac/api/lib/libfmod.a linden/libraries/powerpc-darwin/lib_debug
$ cp -p fmodapi375mac/api/lib/libfmod.a linden/libraries/powerpc-darwin/lib_release
$ cp -p fmodapi375mac/api/lib/libfmodx86.a linden/libraries/i386-darwin/lib_debug/libfmod.a
$ cp -p fmodapi375mac/api/lib/libfmodx86.a linden/libraries/i386-darwin/lib_release/libfmod.a



Building the Viewer

Launch XCode, open the project file 'linden/indra/newview/macview.xcodeproj',

set 'libraries' as the active target, select an active build configuration, build the libraries. After that: set 'newview' as the active target, select an active build configuration, and build the project.

If you had to change gcc versions for a ppc build, restore gcc back to 4.0.

$ sudo gcc_select 4.0

Build Configurations

Development
This configuration is more suitable for debugging. The build process will create the SecondLife application targeted for your host architecture.
Deployment
This configuration is faster than the development version at the cost of some ability to debug. The build process will create the SecondLife application targeted for your host architecture.
Universal
This configuration is the same as the Deployment target except that all supported architectures - ppc and i386 - are built.

Post Build Steps

To deal with some quirks after building see Barney Boomslang post build tips (not everything there may apply to you, but worth checking)



Building the Unit Tests

From XCode, open the project 'linden/indra/test/MacTester.xcodeproj', set 'MacTester' as the active target, and build.



Submitting Patches

This is probably far down the road, but if you make changes to the source and want to submit them, see the page about submitting patches.