Cross compile OpenLDAP for MIPS on Linux/Ubuntu 10.10
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.
I have set up a build.sh
script with the content shown below. It
#!/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 &&
make depend &&
rm -rf install &&
mkdir install &&
make &&
make install DESTDIR=$PWD开发者_运维问答/install &&
sudo make install DESTDIR=/usr/local/angstrom/mipsel/mipsel-angstrom-linux
The build works but aborts with the following:
../../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
I had trouble with other libraries too, adding LIBTOOL=libtool
was once able to solve a problem. I also tried to compile my own mipsel-angstrom-linux-libtool
as suggested by some other resource but that did not work.
I did a grep libz -r .
in the source/build directory but couldn't find anything, I don't know where to look.
I hope someone can give me a hint that allows me to solve my problem.
edit: using the codesourcery toolchain i get result.c:961: undefined reference to lutil_memcmp'
.
using LIBTOOL=libtool
only helps if the libtool installed on your system is different from the one shipped with openldap and dependencies. But indeed this problem is related to libtool, and not libz as the error might indicate. If you look more closely at the error message you see an additional =
:
libtool: link: warning: cannot determine absolute directory name of `=/usr/lib'
the =/usr/lib
is no directory. Where does this =
come from?
I found a patch to libtool responsible for this at libtool-patches that
describes the new function:
If PATH begins with the sysroot, replace it with =
I don't know what is the reasoning behind this but the result can be found in the .la files on your system, maybe run this
grep "=/usr/lib" /usr/lib/*.la
depending on where you install your libraries to find them.
You will see the definition of dependency_libs that includes probably
among others the string =/usr/lib
and this is where the additional =
comes from.
What to do?
having found the wrong .la files find out to which software they belong
and rebuild them using LIBTOOL=/path/to/libtool2.2
.
or if that doesn't work:
perl -p -i -e 's/(func_replace_sysroot_result=")=/$1/' ltmain.sh &&
perl -p -i -e 's/\$\{lt_sysroot:\+=\}//' ltmain.sh
all the best,
Peter
精彩评论