| 1 | {{{#!html |
| 2 | <div id="wikipage" class="trac-content"><p> |
| 3 | </p><div class="wiki-toc"> |
| 4 | <ol> |
| 5 | <li> |
| 6 | <a href="#YoctoSoftwareDevelopmentKitSDK">Yocto Software Development Kit (SDK)</a> |
| 7 | <ol> |
| 8 | <li> |
| 9 | <a href="#UsingtheSDK">Using the SDK</a> |
| 10 | </li> |
| 11 | </ol> |
| 12 | </li> |
| 13 | </ol> |
| 14 | </div><p> |
| 15 | </p> |
| 16 | <h1 id="YoctoSoftwareDevelopmentKitSDK">Yocto Software Development Kit (SDK)</h1> |
| 17 | <p> |
| 18 | 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. |
| 19 | </p> |
| 20 | <ul><li><strong>Note</strong> - <em>for compiling on the Ventana SBC itself, follow instructions here: <a class="wiki" href="/wiki/Yocto/NativeCompile">Native Compiling - SDK</a></em> |
| 21 | </li></ul><p> |
| 22 | Cross Compile SDK Downloads: |
| 23 | </p> |
| 24 | <ul><li><a class="ext-link" href="http://blog.gateworks.com/?wpdmpro=ventana-yocto-1-8-2-sdk-20160328-1730-sh"><span class="icon"></span>Yocto 1.8.2 SDK</a> - (sha256sum: de6b93f543fedba0ad4283fcbe28c7ce1dd0a8c6140f42896ba8fa4364e26cd2) |
| 25 | </li></ul><p> |
| 26 | You can build your own SDK compatible with a filesystem image of your choice using information <a class="wiki" href="/wiki/Yocto/Building#BuildingatoolchainandorSDK">here</a>. |
| 27 | </p> |
| 28 | <h2 id="UsingtheSDK">Using the SDK</h2> |
| 29 | <p> |
| 30 | 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: |
| 31 | </p> |
| 32 | <ul><li>PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH (for pkg-config) |
| 33 | </li><li>CC CXX CPP AS LD GDB STRIP RANLIB OBJCOPY OBJDUMP AR NM CFLAGS CXXFLAGS LDFLAGS CPPFLAGS ARCH CROSS_COMPILE (for make and cmdline use) |
| 34 | </li><li>M4 CONFIGURE_FLAGS (for aclocal/autoconf/autoheader/automake/autoreconf/autoupdate use) |
| 35 | </li></ul><ol><li>Run the downloaded/built <tt>.sh</tt> file and specify an install path: |
| 36 | <div class="code"><pre>/bin/sh ventana-yocto-1.8-sdk-*.sh -d ~/sdk |
| 37 | </pre></div><ul><li>Note that you need write access to the directory you wish to install to. By default this is <tt>/opt/poky/</tt> but you can change it when prompted or via the <tt>-d <dir></tt> parameter |
| 38 | </li><li>do not run the install script as root - if you do, you will need to adjust some directory permissions |
| 39 | </li></ul></li></ol><ol start="2"><li>cd into extracted toolchain: |
| 40 | <div class="code"><pre><span class="nb">cd</span> ~/sdk |
| 41 | </pre></div></li></ol><ol start="3"><li>Activate the environment: |
| 42 | <div class="code"><pre><span class="nb">source </span>environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi |
| 43 | </pre></div><ul><li><strong>You will need to do this per new shell</strong> |
| 44 | </li><li>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. |
| 45 | </li><li>pkg-config is in the SDK path and will provide valid results based on PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH env vars |
| 46 | </li><li>autoconf/automake etc are in the SDK path and will provide valid results based on M4 CONFIGURE_FLAGS env vars |
| 47 | </li></ul></li></ol><ol start="5"><li>Build: |
| 48 | <ul><li>to build a standalone single source app (ie <tt>hellowworld.c</tt>) use variables defined by the environment such as CC, LD, AR, etc: |
| 49 | <div class="code"><pre>cat <span class="s"><< EOF >> /tmp/helloworld.c |
| 50 | #include <stdio.h> |
| 51 | |
| 52 | int main (int argc, char** argv) |
| 53 | { |
| 54 | printf("Hello World\n"); |
| 55 | return 0; |
| 56 | } |
| 57 | EOF</span> |
| 58 | </pre></div><div class="code"><pre><span class="k">${</span><span class="nv">CC</span><span class="k">}</span> /tmp/helloworld.c -o /tmp/helloworld |
| 59 | </pre></div></li><li>to build using a Makefile which properly uses CC/CFLAGS/LDFLAGS/LIBS etc: |
| 60 | <div class="code"><pre>make |
| 61 | </pre></div></li></ul></li></ol |
| 62 | }}} |