User:Dzonatas Sol/Cross compiling the viewer (i686-mingw32)

From Second Life Wiki
< User:Dzonatas Sol
Revision as of 01:49, 4 March 2007 by Dzonatas Sol (talk | contribs) (Initial document)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 of the viewer

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.

Cross Compiler Installation

Download the build script: x86-mingw32-build.sh

Extract all files in the archive to a temporary directory, example:

$ tar xjf x86-mingw32-build.sh-0.0-20061107-1.tar.bz2

Execute the build script with the target platform specified:

$ sh x86-mingw32-build.sh i686-mingw32

For this particular setup, here are the expected responses to the prompts listed below:

  1. Do you wish to select components individually? : NO
  2. Please enter your preferred option: 1
  3. Would you like me to download any of these optional language packages: YES
  1. ada: NO
  2. c++: YES
  3. f77: NO
  4. java: NO
  5. objc: NO
  1. Which directory should I use for the local package repository: (default)
  2. Please select one of the following mirrors: (select your closest mirror)
  3. Would you like to enable NLS for your cross compiler: NO
  4. Would you like to use shared libraries available on this host: YES
  5. Do you wish to retain the standard setjmp/longjmp exception handler: YES
  6. Where should I install the cross-compiler, and its support tools: (default)
  7. Which directory should I use to create the build tree: (default)
  8. 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.

When completely compiled and installed, you will be able to use the command "i686-mingw32-gcc" to cross compile.

Modify any build scripts within the viewer sources to use the cross compiler instead of the default GCC.

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.