From 401be9c8b961cd4fcb6e5d58200dcd06a8c246b2 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Wed, 11 Nov 2020 12:31:47 +0100 Subject: [BUILD] add CMake toolchain files to cross-compile for ppc and aarch64 --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index d8e390e..a46423e 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,26 @@ A value from the range of appropriate values can be assigend to each configurati cmake -D= [-D ...] ../. ``` +With the help of CMake, it is also possible to cross-compile the dnbd3 components for a Linux target architecture other than the compiling Linux host architecture. This repository is shipped with two CMake toolchain files to cross-compile all components for the following two Linux target architectures if necessary. + +> **Note that all used header files (eg. Linux kernel headers) and libraries (eg. jansson, fuse) for the target architecture are installed and set up properly, so that the cross-compiler can find and use them.** + + +#### Cross-Compiling for _powerpc_ Target +If you want to cross-compile all dnbd3 components for the _powerpc_ Linux target architecture (eg. for a Mac G5), make sure that the `powerpc-linux-gnu-gcc` cross-compiler is installed on your host system. Then, call CMake with the shipped toolchain file for this specific cross-compiler as follows. + +```shell +cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/PowerpcLinuxGnu.cmake [-D ...] ../. +``` + + +#### Cross-Compiling for _aarch64_ Target +If you want to cross-compile all dnbd3 components for the _aarch64_ Linux target architecture (eg. for a Raspberry Pi 4), make sure that the `aarch64-linux-gnu-gcc` cross-compiler is installed on your host system. Then, call CMake with the shipped toolchain file for this specific cross-compiler as follows. + +```shell +cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/Aarch64LinuxGnu.cmake [-D ...] ../. +``` + ### Debug In the `Debug` build configuration, all dnbd3 components can be built by calling `make`: -- cgit v1.2.3-55-g7522