Feature #1224
openPort all apps to use installed toolchain.
20%
Description
However, we need to know which hardware we're building for, so all cross.sh need a -b (for "board") option added that can be one of
- rpi1
- rpi2 (for rpi2, rpi3)
- rpi4
- xeon
It might be worthwhile to add common code to a sourced script in the toolchain tree. Then all the cross.sh could do "source <toolchain>/common.sh" and Makefiles could include <toolchain>/common. Or these could go in the higher level ~/.pibox, since these would be board inspecific common bits.
Related issues
Updated by Hammel 23 days ago
- Blocked by Feature #1225: rundock updates to avoid interactive shell added
Updated by Hammel 23 days ago
- % Done changed from 0 to 20
Support for GNU Make builds has been added with the app-defs.mk installation via the xcc-install target. That file can be included in config.mk for GNU Make based builds. See libleak for an example. The use of this can greatly simplify the GNU Make based builds.
Support for autoconf based builds is in development. It isn't clear if the app-defs.mk can be integrated into the .am files or if a shell script will need to be created that slurps it in an parses it into something cross.sh can utilize.
Updated by Hammel 20 days ago
There are now two template implementations for using the new installed toolchain and staging tree.
libleak shows how to use them with GNU Make based builds.
picam shows to use them with autoconf based builds.
The set of builds to port to each example are taken from the metabuild configurations.
GNU Make builds to port (these support -showconfig in cross.sh)
mjpg-streamer: cmake exampleomxplayerpmsuipiboxwww: supports -P for PiSentrypsplash: supports -T to enable for TFT displayspiconf: supports -S <system> - needs fix to clamp to known valuesironman+www: supports -S <system>ironman+monitorironman+ironmancfglcdshowlibleak
Autoconf builds to port (these do not have -showconfig support in cross.sh)
appmgr: supports -P for PiPlayerlaunchersupports-f Force use of colored icons -k Make a kiosk launcher -p Make a piplayer launcher -P Make a piplayer launcher but add terminal app -s Show the config used to run the build. -T Install test configs with app -x Make a xeon launcher
libpiboxpigtkpiboxd-a If set, then package for AutoKiosk System. -p If set, then package for PiPlayer System. -S If set, then package for PiSentry System. -x If set, then package for Xeon System.
piclock: supports -P for PiPlayerpipicspncvideofe-k num Kiosk modes 0: Non-kiosk (normal media center mode) 1: touchscreen kiosk (video picture frame) 2: auto-kiosk (auto-starting, looping videos)
musicfepicam: supports -P for PiSentrypixmpinet: supports-S Set the SSID for the node. -x Enable use on Xeon.
ironman+imrestironman+sensorsraspi2fbpistorepistore+pistoreweb- (xeon) pidialer - needs xeon build ported to install toolchain and staging tree.
Then the various sandboxes need to be updated, rebuilt and installed.
Then the metabuilds for apps needs to be tested against each board type. A -b option for boards needs to be added, which will also determine which Systems are meaningful to the build.
- rpi1
- Player
- Kiosk
- AutoKiosk
- rpi2
- autokiosk
- ironman
- kiosk
- media
- pisentry
- pistore
- player
- rpi4
- media
- pisentry
- xeon
Finally, the new builds + apps need to be tested on hardware.
RM #1224: Migrated to app-defs.mk + docker + cross.sh usage.
RM #1224: Disable AC features of app-defs.mk.
Build:
./cross.sh -b rpi2
./cross.sh -s -b rpi2
./cross.sh -d -b rpi2
./cross.sh -b rpi -t "clobber app-init"
./cross.sh -c
Other options are app specific, such as -T or -S.
Updated by Hammel 16 days ago
cmake programs need to be told where the toolchain stuff is.
First, take a look at these examples and this explanation. The latter gives an example that could be turned into a template under $(HOME)/.pibox. The app-defs.mk can copy this to the top of the build directory and replace tags with build specifics, like the toolchain and staging tree locations based on select board for the build. Then cmake builds can references it
-DCMAKE_TOOLCHAIN_FILE=$(stage)/$1/toolchain.cmake
But this doesn't actually set the pkg-config stuff, just the toolchain stuff.
If it can be set in the environment and used by cmake, try this.
PKG_CONFIG_LIBDIR=${STAGING_DIR}/usr/lib/pkgconfig:${STAGING_DIR}/usr/share/pkgconfig PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR
Alternatively, try modifying this and passing it as
-DCMAKE_TOOLCHAIN_FILE=$(stage)/$1/toolchain.cmake
string(REPLACE "/share/cmake" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR}) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSROOT ${RELOCATED_HOST_DIR}/sysroot) set(CMAKE_FIND_ROOT_PATH ${RELOCATED_HOST_DIR}/sysroot) set(CMAKE_PROGRAM_PATH ${RELOCATED_HOST_DIR}/../tools/bin) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_C_COMPILER aarch64-qsys-linux-gnu-gcc) set(CMAKE_CXX_COMPILER aarch64-qsys-linux-gnu-g++) set(PKG_CONFIG_EXECUTABLE aarch64-qsys-linux-gnu-pkg-config)