title: Cross compile OpenLDAP for MIPS on Linux/Ubuntu 10.10
body: <p>I'm trying to cross compile openldap-2.4.23 on my Ubuntu 10.10 development machine using the mipsel-angstrom-linux toolchain because it is a dependecy to ptlib-2.10.1/opal-3.10.1 which are the libraries that I actually want to use.</p>
  
  <p>I have set up a <code>build.sh</code> script with the content shown below. It</p>
  
  <pre><code>#!/bin/sh
  . /usr/local/angstrom/mipsel/environment-setup 
  
  ./configure CC=mipsel-angstrom-linux-gcc --host=mipsel-angstrom-linux --disable-bdb --disable-hdb --with-yielding_select=no &amp;&amp;
  
  make depend &amp;&amp;
  rm -rf install &amp;&amp;
  mkdir install &amp;&amp;
  make &amp;&amp;
  make install DESTDIR=$PWD/install &amp;&amp;
  sudo make install DESTDIR=/usr/local/angstrom/mipsel/mipsel-angstrom-linux
  </code></pre>
  
  <p>The build works but aborts with the following:</p>
  
  <pre><code>../../libtool: line 3297: cd: =/usr/lib: No such file or directory
  libtool: link: warning: cannot determine absolute directory name of `=/usr/lib'
  grep: =/usr/lib/libz.la: No such file or directory
  /bin/sed: can't read =/usr/lib/libz.la: No such file or directory
  libtool: link: `=/usr/lib/libz.la' is not a valid libtool archive
  make[2]: *** [libldap.la] Error 1
  make[2]: Leaving directory `/home/markus/Documents/VoIP/openldap-2.4.23/libraries/libldap'
  make[1]: *** [all-common] Error 1
  make[1]: Leaving directory `/home/markus/Documents/VoIP/openldap-2.4.23/libraries'
  make: *** [all-common] Error 1
  </code></pre>
  
  <p>I had trouble with other libraries too, adding <code>LIBTOOL=libtool</code> was once able to solve a problem. I also tried to compile my own <code>mipsel-angstrom-linux-libtool</code> as suggested by some other resource but that did not work.</p>
  
  <p>I did a <code>grep libz -r .</code> in the source/build directory but couldn't find anything, I don't know where to look.</p>
  
  <p>I hope someone can give me a hint that allows me to solve my problem.</p>
  
  <p><strong>edit:</strong> using the codesourcery toolchain i get <code>result.c:961: undefined reference to lutil_memcmp'</code>.</p>