Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Mihini/Cross Compilation"
(→Step 3: get Mihini: the sed is no useless) |
m (→Step 4: build and make: cd mihini-repo...) |
||
Line 27: | Line 27: | ||
To finish, let's build it: <source lang="bash"> | To finish, let's build it: <source lang="bash"> | ||
+ | $ cd mihini-repo | ||
$ ./bin/build.sh -t raspberrypi-linaro | $ ./bin/build.sh -t raspberrypi-linaro | ||
$ cd build.raspberrypi-linaro | $ cd build.raspberrypi-linaro | ||
Line 35: | Line 36: | ||
</source> | </source> | ||
− | And Voilà, you have a <code>.deb</code> or a <code>.tar.gz</code> ready to be installed on your RPi ! | + | And Voilà, you have a <code>.deb</code> or a <code>.tar.gz</code> ready to be installed on your RPi ! |
=== Step 5: use it === | === Step 5: use it === |
Revision as of 05:26, 14 August 2013
This page will help you through the process of building your Mihini's installation on your fast and powerful desktop computer for your embbeded architecture.
Contents
Raspbian (RaspberryPi & Debian)
The main files for this platform are already available, so that you will be able to get started quickly ; or it may be used as an example for the others platforms. Please, note that these steps have been validated on a 32 bit OS. Trying to run it on a 64 bit OS may give you errors when trying the build.sh .
Step 1: Get the prerequisites
On a Debian-based system, you will need to:$ sudo apt-get install build-essential cmake git telnet
Step 2: get the toolchain
We are going to use the Linaro toolchain, from the official raspberrypi repository:$ cd $ git clone https://github.com/raspberrypi/tools.git
Step 3: get Mihini
Get the sources$ git clone https://github.com/nim65s/mihini-repo.git
Step 4: build and make
To finish, let's build it:$ cd mihini-repo $ ./bin/build.sh -t raspberrypi-linaro $ cd build.raspberrypi-linaro $ make lua luac # Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample) $ make modbus_serial $ make package
And Voilà, you have a .deb
or a .tar.gz
ready to be installed on your RPi !
Step 5: use it
If you are not sure of what to do with this .deb
, you can go to the Install Mihini page, skipping the first shell command which downloads a similar .deb
.
Then, you can go back to the main tutorial: Run Mihini on an Open Hardware platform
Configuring your own toolchain
The target you specify to build.sh
(which was «raspberrypi-linaro» in the example above) is used to select the toolchain. You will probably need to copy/paste an existing configuration in cmake/
, naming it toolchain.<your target's name>.cmake
, and changing the lines
SET(CMAKE_C_COMPILER /path/to/gcc) SET(CMAKE_CXX_COMPILER /path/to/g++)
Then, you shall also look at the folder porting/
, where you can make a new directory with the name of your target.
Prerequisites for making packages
Debian-based
sudo apt-get install build-essential cmake git telnet
Fedora
sudo yum install cmake gcc-c++ fedora-packager @development-tools telnet
ArchLinux
sudo pacman -Syu base-devel inetutils
Ångström / OpenEmbedded / OpenWRT
opkg install cmake