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

From Second Life Wiki
Jump to navigation Jump to search
Line 18: Line 18:
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 ==
=== GCC (i686-mingw32) ===


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]
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.


Extract all files in the archive to a temporary directory, example:
=== SLViewer ===
:$ tar xjf x86-mingw32-build.sh-0.0-20061107-1.tar.bz2


Execute the build script with the target platform specified:
Patches are being made for the slviewer source to let this compilation happen. You can help!
:$ sh x86-mingw32-build.sh i686-mingw32


For this particular setup, here are the expected responses to the prompts listed below:
== OSLCC Project ==
# 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: NO
# 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.
The Open Second Life Cross Compiler project is a collection of scripts and patches to help automate the build of mingw32 and Second Life.


When completely compiled and installed, you will be able to use the command "i686-mingw32-gcc" to cross compile.
Download and run "build.sh" from this archive, under Linux: [http://dzonux.net/sl/oslcc-20070307.tar.bz2|oslcc-20070307.tar.bz2]


Modify any build scripts within the viewer sources to use the cross compiler instead of the default GCC.
The script will automatically download the files to build the cross compiler and build it. A future version will also build the viewer source.


== Libraries ==
== Libraries ==

Revision as of 03:47, 7 March 2007

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.

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 slviewer source to let this compilation happen. You can help!

OSLCC Project

The Open Second Life Cross Compiler project is a collection of scripts and patches to help automate the build of mingw32 and Second Life.

Download and run "build.sh" from this archive, under Linux: [1]

The script will automatically download the files to build the cross compiler and build it. A future version will also build the viewer source.

Libraries

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.

Known Issues

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