1

我有一个非常基本的问题GNU/Libtool。我的项目是由构建GNU/autotools并包含由构建的共享对象GNU/Libtool。我想i386在机器上编译共享对象x86-64,所以我这样做:

$ ./configure --build=i386
checking for a BSD-compatible install... /usr/bin/install -c
...
checking whether to build shared libraries... no
checking whether to build static libraries... yes
...
config.status: executing depfiles commands
config.status: executing libtool commands
$

配置脚本告诉我不支持共享库,make命令失败。如何解决这个交叉编译问题?

我应该在Libtool 手册中找到答案吗?

4

1 回答 1

2

--build通常用于加拿大交叉编译之类的东西。您可能想要使用该--host选项。您尚未指定系统类型,但如果./config.guess给出如下内容:

x86_64-apple-darwin或者x86_64-pc-linux-gnu

然后你会指定

--host=i386-apple-darwin或者i386-pc-linux-gnu

此外 - 您可能需要设置一些编译器标志来强制生成 32 位代码。例如,

env CC="gcc -m32" ./configure --host=....

通常,该-m32选项就足够了 - 您无需为该--host选项而烦恼。

于 2012-04-26T15:45:08.940 回答