(file) Return to cross-compiling-howto.txt CVS log (file) (dir) Up to [OMI] / omi / doc

File: [OMI] / omi / doc / cross-compiling-howto.txt (download)
Revision: 1.1, Mon Apr 20 17:19:51 2015 UTC (9 years ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

Synopsis:
=========

This short document explains how to build OMI with a cross compiler. Two such
targets are supported today:

    MONTAVISTA_IX86_GNU
    NETBSD_IX86_GNU

To add additional platforms, the 'buildtool' script can be extended to support
them. In general, one would follow the MONTAVISTA_IX86_GNU example.

Terminology:
============

The 'host' platform is where the compiler is run to build OMI. The 'target'
platform is where the output binaries files will run. These can be the same,
but in the case of cross-compiling they are different. This document uses the
term 'target' to refer to the platform where the binaries will be run.

Configuring:
============

By default, the 'configure' script guesses the platform based on the host
environment. But with cross-compiling, the platform is given by the --target
option as shown below:

    ./configure --target=MONTAVISTA_IX86_GNU

Additional options are required to specify to location of the cross-compiler
components. These include:

    --with-cc=PATH          Use C compiler given by PATH.
    --with-cxx=PATH         Use C++ compiler given by PATH.
    --with-ar=PATH          Use archive command (ar) given by PATH.
    --openssl=PATH          Full path to the 'openssl' command.
    --opensslcflags=FLAGS   Extra C flags needed for OpenSSL.
                            (e.g., "-I/usr/local/include").
    --openssllibs=FLAGS     Extra library options needed for OpenSSL.
                            (e.g., "-L/usr/local/lib -lssl -lcrypto").
    --openssllibdir=PATH    The path of the directory containing the desired
                            OpenSSL libraries (ssl and crypto).

So to run configure, one might have something like this:

    ./configure 
        --target=NETBSD_IX86_GNU 
        --with-cc=/opt/toolchain/bin/586-gcc 
        --with-cxx=/opt/toolchain/bin/586-g++ 
        --with-ar=/opt/toolchain/bin/586-ar
        --opensslcflags="-I /opt/toolchain/include" 
        --openssllibdir=/opt/toolchain/lib64 
        --openssllibs="-L/opt/toolchain/lib64 -lssl -lcrypto" 

Of course this is only an example. The exact location of these components will
vary.


ViewCVS 0.9.2