In order to build properly the C source code, you will need the following components to be installed:

In order to build properly the C source code, you will need the following components to be installed:

−

* cmake (&gt;= 2.8.3)

+

* <code>cmake</code> (&gt;= 2.8.3)

−

* gcc

+

* <code>gcc</code>

−

* readline library (optional)

+

* <code>readline</code> library (optional)

−

On Ubuntu/Debian you can install those by installing packages: cmake build-essential libreadline5-dev

+

== Build ==

−

<source lang="bash">

+

<pre>

−

apt-get install cmake build-essential libreadline5-dev

+

$ bin/build.sh

−

</source>

+

</pre>

−

'''Note:''' On Fedora you have to install the "Development Tools" package group and the cmake and readline-devel packages

+

−

<source lang="bash">

+

<pre>

−

yum groupinstall "Development Tools"

+

$ cd build.default

−

yum install cmake readline-devel

+

</pre>

−

yum groupinstall

+

<pre>

−

</source>

+

$ runtime/start.sh

+

</pre>

−

= Configure build system =

+

For detailed explanations, see the following file http://git.eclipse.org/c/mihini/org.eclipse.mihini.git/tree/README.md

−

From this point in this document, we'll use MihiniSources as the root directory of Mihini sources. It must contains folders like "bin", "cmake", "luafmk", "agent" etc.

+

== Run Mihini ==

−

ReadyAgentSources/cmake folder contains toolchains files (named toolchain.*) along with other files (but don't pay attention at other files in cmake folder).<br> Each toolchain file defines a configuration for compiling the sources:

+

Once you built , configured and started Mihini, you should see an output similar to :

−

* (cross-)compiler configuration (most important ones) :

−

<source lang="bash">

−

# specify the cross compiler

−

SET(CMAKE_C_COMPILER /path/to/gcc)

−

SET(CMAKE_CXX_COMPILER /path/to/g++)

−

# where is the target environment

−

SET(CMAKE_FIND_ROOT_PATH /path/to/root/env)

−

</source>

−

−

* other build options related to Mihini integration (those are more likely to be used for fine tuning a Mihini integration, after it is already compiled and running)

−

−

It may also be interesting to make your own toolchains files to adapt the build to your specific environment.

−

−

{{warning|We strongly recommand you to use a the toolchain that was generated while creating the kernel/rootfs of the Linux system running on your device !

−

When compiling on 'regular' personal computer, gcc compiler provided by "build-essential"-like package works out of the box for compiling Mihini, as a result toolchain.default.cmake is almost empty!}}

−

−

= Build =

−

−

Build the software:

−

−

* It is strongly advised to run next line outside from MihiniSources folder

−

* Output files are produced on working_dir/build.$target folder, with $target equals to target specified in build.sh -t argument. <code>MihiniSources/bin/build.sh [-d] [-t &lt;target&gt;]</code> |} Use <code>-d</code> to toggle debugging on

−

−

Use <code>-t &lt;target&gt;</code> to specify the build target. When no target is specified, the default target (named "default") is used: it uses the compiler for the host computer running the build.sh script, using gcc/g++.

−

−

Available targets are the ones corresponding to the toolchain files in <code>cmake</code> directory. Using non default targets will require to install additional cross compiling toolchains.

−

−

== Build artifacts details ==

−

−

* build.$target/runtime : the runtime folder contains all Mihini artifacts that need to be integrated in the target device.

−

* build.$target/runtime/lib contains the libs you may need to link with when developing an application that works with Mihini, like:<br> libSwi_AirVantage.so<br> libSwi_Sms.so<br> libSwi_System.so<br> ...

−

−

* other files and folders in build.$target folder are CMake artifacts, don't modify them, you shouldn't need to look at them.