我试图在我的Ubuntu10.10开发机器上交叉编译openldap-2.4.23,使用mipsel-angstrom-linux工具链,因为它依赖于ptlib-2.10.1/opal-3.10.1,这是我真正想要使用的库。
我已经设置了一个build.sh
脚本,内容如下所示。它
#!/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
该构建可以工作,但在以下情况下中止:
../../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
我与其他库也有问题,添加LIBTOOL=libtool
曾经能够解决一个问题。我还试图像其他资源所建议的那样编译我自己的mipsel-angstrom-linux-libtool
,但这不起作用。
我在源代码/构建目录中做了一个grep libz -r .
,但是找不到任何东西,我不知道该在哪里查找。
我希望有人能给我一个提示,让我解决我的问题。
编辑:使用codesourcery工具链获得result.c:961: undefined reference to lutil_memcmp'
的。
发布于 2011-09-29 11:44:49
只有当安装在系统上的libtool与openldap和依赖项附带的工具不同时,才能使用LIBTOOL=libtool
。但实际上,这个问题与libtool有关,而不是错误可能表明的libz。如果您更仔细地查看错误消息,您将看到一个额外的=
。
libtool: link: warning: cannot determine absolute directory name of `=/usr/lib'
=/usr/lib
不是目录。这个=
是从哪里来的?我在libtool补丁上找到了一个libtool的补丁,它描述了这个新功能:
如果路径以sysroot开头,则将其替换为=
我不知道这背后的原因是什么,但结果可以在您的系统上的.la文件中找到,也许可以运行以下命令
grep "=/usr/lib" /usr/lib/*.la
根据安装库的位置来查找它们。您将看到dependency_libs的定义,其中可能包括字符串=/usr/lib
,这就是额外=
的来源。
该怎么办呢?
找到错误的.la文件后,找出它们属于哪个软件,然后使用LIBTOOL=/path/to/libtool2.2
重新构建它们。
或者如果不起作用:
perl -p -i -e 's/(func_replace_sysroot_result=")=/$1/' ltmain.sh &&
perl -p -i -e 's/\$\{lt_sysroot:\+=\}//' ltmain.sh
一切顺利,
彼得
https://stackoverflow.com/questions/6467502
复制相似问题