Geany - Howto easily configure ARM C/C++ toolchain for cross-compilation

597 Views Asked by At

I am an embedded linux newbie and want to use Geany as a lightweight IDE for application developent for an embedded linux system. The development system is Ubuntu 16.04, the target is a STM32MP1 board (ARM Cortex-A7). The cross-compilation toolchain on Ubuntu is already installed and works. The typical workflow to build an application on command line is:

  • open terminal
  • call source [Path]/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
  • call make

That works, but how can I achive this with Geany? The shell file, that is called once by the source command, contains many commands (exports, path extension etc.) that are executed to setup the ARM toolchain for the opened terminal.

Is there an easy way to include this file or it's content in Geany's build configuration? So that I can compile single files and build/link the entire application by using the Geany toolbar items?

1

There are 1 best solutions below

2
On BEST ANSWER

That works, but how can I achive this with Geany?

Go to Build -> Set Build Commands.

Then set the compile command to:

sh -c 'source "[Path]/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi" && make'
# substitute sh with the shell you want to actually run

# or if your default shell is the one you want to run
# I suspect `geany` just calls `system()`
source "[Path]/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi" && make