Difference between revisions of "User:Dzonatas Sol/Cross compiling the viewer (i686-mingw32)"

From Second Life Wiki
Jump to navigation Jump to search
m (Cross compiling the viewer (i686-mingw32) moved to User:Dzonatas Sol/Cross compiling the viewer (i686-mingw32): Outdated page for which the only substantive edits were by Dzonatas Sol)
 
(17 intermediate revisions by 2 users not shown)
Line 7: Line 7:
== Installation ==
== Installation ==


These instructions are intended for those already familiar on how to compile the viewer on Windows and Linux environment. Please refer to those pages on how to retrieve and setup dependencies to the related host and target platform.
These instructions are intended for those already familiar on how to compile the viewer on Windows and Linux environments. Please refer to those pages for additional help on how to retrieve and setup dependencies to the related host and target platform.


=== SDKs ===
=== SDKs ===
Line 14: Line 14:
* [http://www.microsoft.com/directx/sdk DirectX SDK]
* [http://www.microsoft.com/directx/sdk DirectX SDK]
* [http://developer.apple.com/quicktime/download QuickTime SDK]
* [http://developer.apple.com/quicktime/download QuickTime SDK]
* [http://www.boost-consulting.com/download.html Boost++ SDK] (Pick "Visual C++ 8.0" & "Multithread, static runtime")


We'll use the C/C++ includes and code libraries of these packages.
We'll use the C/C++ includes and code libraries of these packages.


== Cross Compiler Installation ==
There are a few header files needed from either the [http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&DisplayLang=en Microsoft Platform SDK] or the WINE source code. For now, you just need the dbghelp.h file.


Download the build script: [http://sourceforge.net/project/downloading.php?group_id=2435&filename=x86-mingw32-build.sh-0.0-20061107-1.tar.bz2 x86-mingw32-build.sh]
=== GCC (i686-mingw32) ===


Extract all files in the archive to a temporary directory, example:
Under Linux, we'll use the [http://www.mingw.org Minimalist GNU for Windows] Compiler to cross compile. We can recompile binutils and GCC for the i686 and win32, and mingw32 adds the compatible headers, libraries, and compiler support as normally found under the Windows environment.
:$ tar xjf x86-mingw32-build.sh-0.0-20061107-1.tar.bz2


Execute the build script with the target platform specified:
=== SLViewer ===
:$ sh x86-mingw32-build.sh i686-mingw32


For this particular setup, here are the expected responses to the prompts listed below:
Patches are being made for the sl-viewer source to let this compilation happen. You can help!
# Do you wish to select components individually? : NO
# Please enter your preferred option: 1
# Would you like me to download any of these optional language packages: YES
:# ada: NO
:# c++: YES
:# f77: NO
:# java: NO
:# objc: NO
# Which directory should I use for the local package repository: (default)
# Please select one of the following mirrors: (select your closest mirror)
# Would you like to enable NLS for your cross compiler: NO
# Would you like to use shared libraries available on this host: YES
# Do you wish to retain the standard setjmp/longjmp exception handler: YES
# Where should I install the cross-compiler, and its support tools: (default)
# Which directory should I use to create the build tree: (default)
# Would you like me to delete all build files, when I'm done: NO


The package will build at this point. It will take awhile your first time. You can modify the configuration steps above if you need to download or rebuild portions of the cross compiler.
=== LL Libraries ===


When completely compiled and installed, you will be able to use the command "i686-mingw32-gcc" to cross compile.
All the win32 version of Linden's Lab libraries archive will work with this compilation. However, OSLCC provides scripts to rebuild the libraries for mingw32 to makes builds easier and allows a uniform set of debug tools.


Modify any build scripts within the viewer sources to use the cross compiler instead of the default GCC.
== Known Issues ==
 
There are some known issues with the un-patched source in relation to cross compilation:
* [https://jira.secondlife.com/browse/VWR-187 VWR-187: confusion with LL_WINDOWS|LL_LINUX|etc being used to select target platform and assumed compiler]
 
== OSLCC Project ==


== Libraries ==
The [http://sourceforge.net/projects/oslcc/ Open Second Life Cross Compiler] project is being hosted on [http://sourceforge.net Sourceforge]. Currently, it uses a patched snapshot of the viewer source code. It automates the cross compile process as noted above as much as possible. You must have Subversion installed on your Linux system to access this project.


The dependencies of the code libraries are dependent on compile-time libraries and run-time libraries. A few of the run-time libraries you will not be able to cross compiler do to copyright restrictions on the source distribution. Use the pre-built code libraries of the target platform (Win32 DLLs) for those that you cannot cross compile from the host build environment.
Within Linux, create a new workspace directory and cd to it. Run these commands to start the build:
<pre>$ svn co https://oslcc.svn.sourceforge.net/svnroot/oslcc/osl/trunk osl
$ sh osl/build.sh
</pre>


== Known Issues ==
The first time you run the script, it will first download additional files and automatically build the cross compiler. It will continue onto check for SDKs and other files to install and setup. It will prompt you for them if it can't find them. Re-run the script once you have followed the prompts. When all files are in place, it will build the sl-viewer.


There are some known issues with the source in relation to cross compilation:
[[Category:Compiling viewer]]
* [https://jira.secondlife.com/browse/VWR-187 VWR-187: confusion with LL_WINDOWS|LL_LINUX|etc being used to select target platform and assumed compiler]

Latest revision as of 17:42, 28 October 2008

Listed below is the process to cross compile the Second Life viewer on Linux with a Win32 target. This process has only been used on debian and debian based systems like ubuntu. For other platforms, see Get source and compile.

This process is not trivial.

Installation

These instructions are intended for those already familiar on how to compile the viewer on Windows and Linux environments. Please refer to those pages for additional help on how to retrieve and setup dependencies to the related host and target platform.

SDKs

Under Windows or WINE, you will need to install these Software Development Kits:

We'll use the C/C++ includes and code libraries of these packages.

There are a few header files needed from either the Microsoft Platform SDK or the WINE source code. For now, you just need the dbghelp.h file.

GCC (i686-mingw32)

Under Linux, we'll use the Minimalist GNU for Windows Compiler to cross compile. We can recompile binutils and GCC for the i686 and win32, and mingw32 adds the compatible headers, libraries, and compiler support as normally found under the Windows environment.

SLViewer

Patches are being made for the sl-viewer source to let this compilation happen. You can help!

LL Libraries

All the win32 version of Linden's Lab libraries archive will work with this compilation. However, OSLCC provides scripts to rebuild the libraries for mingw32 to makes builds easier and allows a uniform set of debug tools.

Known Issues

There are some known issues with the un-patched source in relation to cross compilation:

OSLCC Project

The Open Second Life Cross Compiler project is being hosted on Sourceforge. Currently, it uses a patched snapshot of the viewer source code. It automates the cross compile process as noted above as much as possible. You must have Subversion installed on your Linux system to access this project.

Within Linux, create a new workspace directory and cd to it. Run these commands to start the build:

$ svn co https://oslcc.svn.sourceforge.net/svnroot/oslcc/osl/trunk osl
$ sh osl/build.sh

The first time you run the script, it will first download additional files and automatically build the cross compiler. It will continue onto check for SDKs and other files to install and setup. It will prompt you for them if it can't find them. Re-run the script once you have followed the prompts. When all files are in place, it will build the sl-viewer.