title: How to link libraries when cross compiling
body: <p>I'm cross compiling open VMWare tools. I pre-compiled glib and i'm setting the <code>PKG_CONFIG_PATH</code> variable to link them.
  I'm getting the following errors in the link stage.</p>
  <pre><code>libtool: link: warning: library `/u/git/extlib_vmtools/usr/local/lib/libgthread-2.0.la' was moved.
  /bin/grep: /usr/local/lib/libglib-2.0.la: No such file or directory
  /bin/sed: can't read /usr/local/lib/libglib-2.0.la: No such file or directory
  libtool: link: `/usr/local/lib/libglib-2.0.la' is not a valid libtool archive
  make[2]: *** [libhgfs.la] Error 1
  make[2]: Leaving directory `/u/git/extlib_vmtools/src/open-vm-tools-11.0.0-14549434/libhgfs'
  make[1]: *** [all-recursive] Error 1
  make[1]: Leaving directory `/u/git/extlib_vmtools/src/open-vm-tools-11.0.0-14549434'
  </code></pre>
  <p>I followed this helpful post (<a href="https://stackoverflow.com/questions/11307465/destdir-and-prefix-of-make">DESTDIR and PREFIX of make</a>) but I think i'm missing something.
  I didn't set the <code>--prefix</code> for any module, since I want to use the default direcotry structure when deploying.</p>
  <p>glib compilation (lower module):</p>
  <pre><code>./configure --host=${CROSS_COMPILE_HOST}
  make
  make install DESTDIR=/home/xport/
  </code></pre>
  <p>open-vmware-tools compilation (upper module):</p>
  <pre><code>export PKG_CONFIG_SYSROOT_DIR=&quot;/home/xport/&quot;
  export PKG_CONFIG_PATH=&quot;/home/xport/usr/local/lib/pkgconfig&quot;
  autoreconf -i
  ./configure --host=${CROSS_COMPILE_HOST} --enable-lib64=no --without-kernel-modules --without-pam --disable-vgauth --without-x --without-gtk3 --without-gtk2 --without-gtkmm3 --without-gtkmm --enable-resolutionkms=no --enable-deploypkg=no
  make
  make install DESTDIR=/home/xport # &lt;-- I don't even get here
  </code></pre>
  <p>Before I set the <code>PKG_CONFIG_PATH</code> variable, the second make failed due to missing .h files... So I know that <code>.pc</code> linkage works.
  What am I missing ?
  Thanks !</p>