1

我正在尝试使用 mipsel-angstrom-linux 工具链在我的 Ubuntu 10.10 开发机器上交叉编译 openldap-2.4.23,因为它是 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'

4

1 回答 1

2

LIBTOOL=libtool仅当系统上安装的 libtool 与 openldap 和依赖项附带的 libtool 不同时,使用才有帮助。但确实这个问题与 libtool 有关,而不是错误可能表明的 libz。如果您更仔细地查看错误消息,您会看到额外的=

libtool: link: warning: cannot determine absolute directory name of `=/usr/lib'

=/usr/lib没有目录。这=是从哪里来的?我在libtool-patches找到了一个负责此问题的libtool 补丁,该补丁描述了新功能:

如果 PATH 以 sysroot 开头,请将其替换为 =

我不知道这背后的原因是什么,但结果可以在您系统上的 .la 文件中找到,也许运行这个

grep "=/usr/lib" /usr/lib/*.la

取决于您安装库的位置以找到它们。您将看到dependency_libs 的定义,其中可能包括字符串=/usr/lib,这就是附加的=来源。

该怎么办?

找到错误的 .la 文件后,找出它们所属的软件并使用 .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

祝一切顺利,

彼得

于 2011-09-29T11:44:49.130 回答