[[PageOutline]] = Yocto Software Development Kit (SDK) = Gateworks provides a Software Development Kit (SDK) compatible with the Yocto Board Support Package (BSP). This SDK provides a cross-toolchain and libraries compatible with the gateworks-gui-image that we provide as a pre-built downloadable disk image so that you can build applications that will run on top of Yocto installed on a Ventana board without having to have build the entire BSP yourself. * Note - for compiling on the Ventana SBC itself, follow instructions here: [wiki:Yocto/NativeCompile Native Compiling - SDK] Cross Compile SDK Downloads: * ​[http://blog.gateworks.com/?wpdmpro=ventana-yocto-2-3-1-sdk-20170830-sh Yocto 2.3.1 SDK] - (sha256sum: b60308cdb1653727054cdb09ef06300d163c283a4128ab57953f69a5dcdae509) * ​[http://blog.gateworks.com/?wpdmpro=ventana-yocto-1-8-2-sdk-20160328-1730-sh Yocto 1.8.2] SDK - (sha256sum: 9dd9b5a2174ad139ccd566596e5ede83071665b5c00d47c9cfab9fa88d88ba8f) You can build your own SDK compatible with a filesystem image of your choice using information [wiki:Yocto/Building#BuildingatoolchainandorSDK here]. == Using the SDK == To use the SDK you need to source the setup-environment* script in the installation directory. This script will augment your path and set several env variables useful for cross-compiling: * PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH (for pkg-config) * CC CXX CPP AS LD GDB STRIP RANLIB OBJCOPY OBJDUMP AR NM CFLAGS CXXFLAGS LDFLAGS CPPFLAGS ARCH CROSS_COMPILE (for make and cmdline use) * M4 CONFIGURE_FLAGS (for aclocal/autoconf/autoheader/automake/autoreconf/autoupdate use) Instructions: 1. Run the downloaded/built .sh file and specify an install path: {{{#!bash chmod +x ventana-yocto-2.3-sdk-*.sh ./ventana-yocto-2.3-sdk-*.sh -d ~/sdk }}} * Note that you need write access to the directory you wish to install to. By default this is /opt/poky/ but you can change it when prompted or via the -d parameter * do not run the install script as root - if you do, you will need to adjust some directory permissions 2. cd into extracted toolchain: {{{#!bash cd ~/sdk }}} 3. Activate the environment: {{{#!bash source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi }}} * **You will need to do this per new shell** * The toolchain executables and various support apps will be in your path, but you need to make sure you are using them by using the env vars above in your build instructions and Makefiles. * pkg-config is in the SDK path and will provide valid results based on PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH env vars * autoconf/automake etc are in the SDK path and will provide valid results based on M4 CONFIGURE_FLAGS env vars 4. Build: * to build a standalone single source app (ie hellowworld.c) use variables defined by the environment such as CC, LD, AR, etc: {{{#!bash cat << EOF >> helloworld.c #include int main (int argc, char** argv) { printf("Hello World\n"); return 0; } EOF $ ${CC} helloworld.c -o helloworld $ file helloworld helloworld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=6f867176027322dff8c2fbd469cdff804547e2d7, not stripped }}} * to build using a Makefile which properly uses CC/CFLAGS/LDFLAGS/LIBS etc: {{{#!bash make }}} For more complete examples see: * ​[http://www.yoctoproject.org/docs/2.3/sdk-manual/sdk-manual.html Yocto SDK manual]