title: How do you properly build gpiod applications from Yocto?
body: <p>I am trying to incorporate a CPLD programming utility on Github available at <a href="https://github.com/kontron/altera-stapl" rel="nofollow noreferrer">https://github.com/kontron/altera-stapl</a> into my Yocto build but am getting undefined references to gpiod functions.  I have that it depends on libgpiod in my recipe.  Am I specifying the dependency correctly?</p>
  
  <p>Here is my recipe: </p>
  
  <pre><code>SUMMARY = "CPLD STAPL Programming"
  
  DESCRIPTION = "A userspace port of the Altera Jam STAPL Bytecode Player."
  MAINTAINER = "Michael Walle &lt;michael.walle@kontron.com&gt;"
  HOMEPAGE = "https://github.com/kontron/altera-stapl"
  
  LICENSE = "GPLv2"
  LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b"
  
  SRC_URI = "git://github.com/kontron/altera-stapl.git"
  SRCREV = "71540fb3dccf57ea0e43cef77d628244de402152"
  SRC_URI[sha256sum] = "DCF8A052CD7908F484EAEE8A1924809056611E68EA28652E17C021BE836FAA6C"
  
  DEPENDS = "libgpiod"
  
  S="${WORKDIR}/git"
  
  do_install () {
     install -d ${D}${bindir}
     install -m 0755 altera-stapl ${D}${bindir} 
  }
  </code></pre>
  
  <p>These are the linker errors I am getting (there are a lot of them, not just this one, I can post the whole log if needed)</p>
  
  <pre><code>gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/ld: altera-gpio.c:(.text+0x3f4): undefined reference to `gpiod_line_request_output'
  /home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/altera-stapl/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/ld: altera-gpio.o: in function `close_jtag_hardware':
  altera-gpio.c:(.text+0x4da): undefined reference to `gpiod_line_release'
  collect2: error: ld returned 1 exit status
  Makefile:31: recipe for target 'altera-stapl' failed
  </code></pre>
  
  <p>What is the correct way to set the dependency?
  Update: I am running Yocto Zeus on Ubuntu 18.04 (my GCC is 7.4.0).</p>