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

From Second Life Wiki
Jump to navigation Jump to search
(Breaking out instructions from Compiling the viewer)
 
 
(209 intermediate revisions by 43 users not shown)
Line 1: Line 1:
{{CompileNav}}
#REDIRECT [[Compiling the viewer (Mac OS X XCode 6.1)]]
 
The following are instructions for building the Second Life viewer on Mac OS X.  For other platforms, see [[Compiling the viewer]]
 
==== Development Environment ====
We use XCode 2.3 for building on Macintosh computers. For simplicity, we suggest installing everything from the mpkg.
 
==== Installing Libraries ====
We recommend creating a separate third party library directory named 'lindenlib' on the same level as the 'linden' tree in your directory structure. Download, unpack, and build from there and copy the files specified to their final location.
 
Most of the libs built here are architecture specific, so these instructions will refer to <em>$PLATFORM</em> to denote that. You can set an environment variable to make it so copy & paste from these instructions will work:
<pre>
$ PLATFORM=`uname -p`-darwin
</pre>
===== Boost =====
Download & extract [http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041 Boost] source.
The viewer does not link to the boost libraries, so much of this is not necessary. You can simply copy the header files if you have problems getting the boost package to build.
====== Copy the Headers ======
<pre>
$ cp -r lindenlib/boost-1.33.0/boost linden/libraries/include/boost
</pre>
====== Build Boost.Jam ======
<pre>
$ cd boost-1.33.0/tools/build/jam_src
$ ./build.sh
$ cp bin.macosxppc/bjam ../../..
</pre>
====== Build Boost ======
<pre>
$ cd boost-1.33.0/libs
$ export PYTHON_ROOT=/System/Library/Frameworks/Python.framework/Versions/2.3/
$ export PYTHON_VERSION=2.3
$ ./bjam stage
</pre>
====== Copy the Libraries ======
Assuming you are running on a powerpc mac, this will work. If you are working from an intel mac, replace PLATFORM with 'i386-darwin'.
<pre>
$ cd boost-1.33.0
$ export PLATFORM=powerpc-darwin
$ cp src/stage/lib/libboost_python-gcc.a \
libraries/$PLATFORM/lib_release
$ cp src/stage/lib/libboost_python-gcc-d.a \
libraries/$PLATFORM/lib_debug/libboost_python-gcc.a
$ cp src/stage/lib/libboost_python-gcc-mt.a \
libraries/$PLATFORM/lib_release
$ cp src/stage/lib/libboost_python-gcc-mt-d.a \
libraries/$PLATFORM/lib_debug/libboost_python-gcc-mt.a
$ cp src/stage/lib/libboost_regex-gcc.a \
libraries/$PLATFORM/lib_release
$ cp src/stage/lib/libboost_regex-gcc-d.a \
libraries/$PLATFORM/lib_debug/libboost_regex-gcc.a
$ cp src/stage/lib/libboost_regex-gcc-mt.a \
libraries/$PLATFORM/lib_release
$ cp src/stage/lib/libboost_regex-gcc-mt-d.a \
libraries/$PLATFORM/lib_debug/libboost_regex-gcc-mt.a
</pre>
 
===== Apache Portable Runtime =====
* Download & extract [http://apr.apache.org/download.cgi apr and apr-util].
* Build and install the headers and lib files using a terminal.
<pre>
$ cd lindenlib/apr-1.2.8
$ ./configure --disable-shared --disable-lfs --prefix=/tmp/apr
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/apr/include/apr-1 linden/libraries/$PLATFORM/include
$ cp /tmp/apr/lib/libapr-1.a linden/libraries/$PLATFORM/lib_release
$ cp /tmp/apr/lib/libapr-1.a linden/libraries/$PLATFORM/lib_debug
 
$ cd lindenlib/apr-util-1.2.8
$ ./configure --disable-shared --disable-lfs --with-apr=/tmp/apr --prefix=/tmp/apr-util
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/apr-util/include/apr-1 linden/libraries/$PLATFORM/include
$ cp /tmp/apr-util/lib/*.a linden/libraries/$PLATFORM/lib_release
$ cp /tmp/apr-util/lib/*.a linden/libraries/$PLATFORM/lib_debug
</pre>
 
===== Expat =====
* Download extract the 1.95.8 version of [http://sourceforge.net/projects/expat/ expat].
* Build and install the library
<pre>
$ cd expat-1.95.8
$ ./configure --prefix=/tmp/expat
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/expat/include linden/libraries/include/expat
$ cp -p /tmp/expat/lib/libexpat.a linden/libraries/$PLATFORM/lib_release
$ cp -p /tmp/expat/lib/libexpat.a linden/libraries/$PLATFORM/lib_debug
</pre>
 
===== Freetype =====
* Download and extract [http://freetype.sourceforge.net/download.html#stable FreeType].
* Build and install the FreeType library:
<pre>
$ cd freetype-2.2.1
$ ./configure --prefix=/tmp/freetype
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/freetype/include/freetype2/freetype linden/libraries/include
$ cp -p /tmp/freetype/lib/libfreetype.a linden/libraries/$PLATFORM/lib_release
$ cp -p /tmp/freetype/lib/libfreetype.a linden/libraries/$PLATFORM/lib_debug
</pre>
 
===== OpenGL Extensions =====
* Download [http://oss.sgi.com/projects/ogl-sample/sdk.html glext.h, glxext.h, and wglext.h]
* Copy them to linden/libraries/include/GL
 
===== XMLRPC-epi =====
* Download a source package for [http://xmlrpc-epi.sourceforge.net/ xmlrpc-epi].
* Apply patch 1 and 2 from the instructions in [[patch xmlrpc-epi]].
* Configure the project:
<pre>
cd xmlrpc-epi-0.51
./configure --disable-shared --prefix=/tmp/xmlrpc-epi
</pre>
* Apply patch 3 from the instructions in [[patch xmlrpc-epi]].
* Finish the removal of expat, build, and install
<pre>
$ rm -rf expat
$ mkdir expat
$ cp /tmp/expat/include/* expat
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/xmlrpc-epi/include linden/libraries/include/xmlrpc-epi
$ cp -p /tmp/xmlrpc-epi/lib/libxmlrpc.a linden/libraries/$PLATFORM/lib_release
$ cp -p /tmp/xmlrpc-epi/lib/libxmlrpc.a linden/libraries/$PLATFORM/lib_debug
</pre>
 
===== Vorbis & Ogg =====
* Download & extract [http://www.xiph.org/downloads/ libvorbis].
* Download & extract [http://www.xiph.org/downloads/ libogg].
* Build & copy libogg first:
<pre>
$ cd libogg-1.1.3
$ ./configure --prefix=/tmp/ogg
$ make
$ make install
$ cd ../..
$ cp -pR /tmp/ogg/include/ogg linden/libraries/include
$ cp -p /tmp/ogg/lib/libogg.a linden/libraries/$PLATFORM/lib_debug
$ cp -p /tmp/ogg/lib/libogg.a linden/libraries/$PLATFORM/lib_release
</pre>
* Build & copy libvorbis:
<pre>
$ cd libvorbis-1.1.2
$ ./configure --prefix=/tmp/vorbis --with-ogg=/tmp/ogg
$ make
$ make install
$ ../..
$ cp -pR /tmp/vorbis/include/vorbis linden/libraries/include
$ cp -p /tmp/vorbis/lib/libvorbis*.a linden/libraries/$PLATFORM/lib_debug
$ cp -p /tmp/vorbis/lib/libvorbis*.a linden/libraries/$PLATFORM/lib_release
</pre>
 
===== Fmod =====
* Download & extract [http://www.fmod.org/ifmoddownload.html fmod 3.75 programmers api for macintosh].
* Copy the extracted files
<pre>
$ cp -p fmodapi375win/api/inc/*.h linden/libraries/include
$ cp -p fmodapi375win/api/lib/libfmod.a linden/libraries/powerpc-darwin/lib_debug
$ cp -p fmodapi375win/api/lib/libfmod.a linden/libraries/powerpc-darwin/lib_release
$ cp -p fmodapi375win/api/lib/libfmodx86.a linden/libraries/i386-darwin/lib_debug
$ cp -p fmodapi375win/api/lib/libfmodx86.a linden/libraries/i386-darwin/lib_release
</pre>
 
===== OpenJPEG =====
* Download and extract [http://www.openjpeg.org/index.php?menu=download openjpeg] source.
* Copy the [[make openjpeg|linden openjpeg makefiles]] into the openjpeg source top level directory. We have to do this to maintain 10.3.9 compatibility.
* Build and install the library
<pre>
$ mkdir ../../linden/libraries/include/openjpeg
$ cp -p libopenjpeg/openjpeg.h ../../linden/libraries/include/openjpeg
$ make -f Makefile-i386.ppc libopenjpeg.a
$ cp libopenjpeg.a ../../linden/libraries/ppc-darwin/lib_debug
$ cp libopenjpeg.a ../../linden/libraries/ppc-darwin/lib_release
$ make -f Makefile-i386.ppc clean
$ make -f Makefile-i386.osx libopenjpeg.a
$ cp libopenjpeg.a ../../linden/libraries/i386-darwin/lib_debug
$ cp libopenjpeg.a ../../linden/libraries/i386-darwin/lib_release
</pre>
 
===== TUT =====
* Download [http://tut-framework.sourceforge.net/download/ tut] into lindenlib
* Move it into a sub-directory, extract, and copy the headers
<pre>
$ mkdir tut
$ mv TUT-2006-11-04.tar.gz tut
$ cd tut
$ tar xvzf TUT-2006-11-04.tar.gz
$ cd ../..
$ mkdir linden/libraries/include/tut
$ cp -p lindenlib/tut/tut.h lindenlib/tut/tut_reporter.h lindenlib/tut/tut_restartable.h linden/libraries/include/tut
</pre>
 
===== Mozilla =====
* looks like these were written by us
* Download and extract [ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/ static]?
* uh oh

Latest revision as of 12:30, 23 April 2015