Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit c604de9

Browse files
committed
Update cross compile info
1 parent fb7e89a commit c604de9

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

CrossCompileHowto.txt

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
ON RASPBERRY
1+
ON TARGET
22
--------------
33
sudo apt-get install libQt4-dev libusb-1.0-0-dev python-dev rsync
44

55
ON HOST
66
---------
7-
export RASPI=192.168.1.17
7+
export TARGET_IP=192.168.1.17
8+
export TARGET_USER=pi
9+
810
export RASCROSS_DIR="$HOME/raspberrypi"
11+
export ROOTFS_DIR="RASCROSS_DIR/rootfs"
912
export HYPERION_DIR="$HOME/hyperion"
13+
export TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake"
14+
15+
export NATIVE_BUILD_DIR="$HYPERION_DIR/build"
16+
export TARGET_BUILD_DIR=HYPERION_DIR="$HYPERION_DIR/build-rpi"
1017

1118
# install required packages
1219
sudo apt-get install git rsync cmake build-essential libQt4-dev libusb-1.0-0-dev python-dev
@@ -16,17 +23,21 @@ sudo apt-get install git rsync cmake ia32-libs protobuf-compiler
1623
# install solved this for me (TODO: verify what is really required)
1724
sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386
1825

19-
# create the rootfs by copying it from an rpi running for example raspbmc
20-
mkdir -p "$RASCROSS_DIR/rootfs"
21-
rsync -rl --delete-after --safe-links pi@$RASPI:/{lib,usr} "$RASCROSS_DIR/rootfs"
26+
# create the rootfs by copying it from an target
27+
mkdir -p "$ROOTFS_DIR"
28+
rsync -rl --delete-after --copy-unsafe-links $TARGET_USER@$TARGET_IP:/{lib,usr} "$ROOTFS_DIR"
29+
30+
######## RPi specific #########
2231

2332
# get the raspberry pi firmware and add it to the rootfs
2433
git clone https://github.com/raspberrypi/firmware.git "$RASCROSS_DIR/firmware"
25-
ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$RASCROSS_DIR/rootfs/opt"
34+
ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$ROOTFS_DIR/opt"
2635

2736
# get the compile tools
2837
git clone git://github.com/raspberrypi/tools.git "$RASCROSS_DIR/tools"
2938

39+
##### End of RPi specific ######
40+
3041
# get the Hyperion sources
3142
git clone --recursive https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
3243

@@ -36,13 +47,13 @@ git submodule init
3647
git submodule update
3748

3849
# do a native build (to build the protobuf compiler for the native platform)
39-
mkdir "$HYPERION_DIR/build"
40-
cmake -DENABLE_DISPMANX=OFF --build "$HYPERION_DIR/build" "$HYPERION_DIR"
50+
mkdir -p "$NATIVE_BUILD_DIR"
51+
cmake -DENABLE_DISPMANX=OFF --build "$NATIVE_BUILD_DIR" "$HYPERION_DIR"
4152

42-
# do the rpi build
53+
# do the cross build
4354
# specify the protoc export file to import the protobuf compiler from the native build
44-
mkdir "$HYPERION_DIR/build-rpi"
45-
cmake -DCMAKE_TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake" -DIMPORT_PROTOC=$HYPERION_DIR/build/protoc_export.cmake --build "$HYPERION_DIR/build-rpi" "$HYPERION_DIR"
55+
mkdir -p "$TARGET_BUILD_DIR"
56+
cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DIMPORT_PROTOC=$NATIVE_BUILD_DIR/protoc_export.cmake --build "$TARGET_BUILD_DIR" "$HYPERION_DIR"
4657

4758
------------------------------------------------------------------------------
4859
These instructions are based on the guide given by:

libsrc/effectengine/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
find_package(PythonLibs REQUIRED)
33

4-
include_directories(${PYTHON_INCLUDE_DIRS})
4+
# Include the python directory. Also include the parent (which is for example /usr/include)
5+
# which may be required when it is not includes by the (cross-) compiler by default.
6+
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
57

68
# Define the current source locations
79
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/effectengine)

0 commit comments

Comments
 (0)