This is very similar to Building firmware on Gentoo, the hard way except for openSUSE Leap (42.3 currently) instead of Gentoo. And before I go further, let me clarify that I can already build firmware fine using the Arduino download from https://www.arduino.cc/en/Main/Software - but I want to do it with the openSUSE native Arduino packages too. So here’s what I’ve figured out so far for the latter case:
Firstly manually remove the -tools "${ARDUINO_PATH}/tools-builder"
line from Arduino-Boards/libraries/Kaleidoscope/bin/kaleidoscope-builder
as mentioned in Building firmware on Gentoo, the hard way. Then do:
sudo zypper ar -f https://download.opensuse.org/repositories/Java:/packages/openSUSE_Leap_42.3/Java:packages.repo
sudo zypper ar -f https://download.opensuse.org/repositories/CrossToolchain:/avr/openSUSE_Leap_42.3/CrossToolchain:avr.repo
sudo zypper in Arduino{,-kit} cross-avr-gcc
export ARDUINO_PATH=/usr/share/arduino
export ARDUINO_BUILDER=/usr/bin/arduino-builder
export AVR_GCC_PREFIX=/usr
cd Model01-Firmware # assuming already cloned
make flash
This results in:
BOARD_HARDWARE_PATH="/home/adam/software/hardware/Arduino/hardware" /home/adam/software/hardware/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.22-33-gea59) ...
In file included from /tmp/tmp.LhNeGQlRza/sketch/Model01-Firmware.ino.cpp:1:0:
/usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h:23:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
exit status 1
/home/adam/software/hardware/Arduino/hardware/keyboardio/avr/build-tools/makefiles//rules.mk:75: recipe for target 'flash' failed
make: *** [flash] Error 1
which is where I’m currently stuck. I’m sure it’s something to do with it not looking in the standard places for stdlib.h
due to use of the cross-compiler. In fact I note that even though cross-avr-gcc
installs to /opt/cross
, /opt/cross/include
is currently empty, which looks wrong.