在 Snow Leopard 64 位上处理 32 位代码?
我想为我正在构建的 XULRunner 应用程序创建一个 XPCOM 插件。由于 Mozilla 仅提供 XULRunner SDK 的 32 位版本,因此我必须链接 32 位库。这意味着很多库需要我自己构建。
与此相关,我有几个问题:
我可以为 32 位构建执行 sudo make install
吗?或者它会弄乱我的系统吗?
如果我做不到,那么解决方法是什么?
我当前的解决方案是在配置命令中包含 lib 目录:
CFLAGS=" -arch i386" CCFLAGS=" -arch i386" CXXFLAGS=" -arch i386" LDFLAGS=" -L`pwd`/../libs/gst-plugins-base -L`pwd`/../libs/liboil -arch i386" ./configure
这是要走的路还是更好的选择?
I would like to create an XPCOM plugin for a XULRunner application that I'm building. Since Mozilla only provides a 32-bit build of the XULRunner SDK I have to link with 32-bit libraries. This means that a lot of libraries need to be built by me.
Relating this I have a few questions:
Can I do a sudo make install
for a 32-bit build? Or will it mess up my system?
If I can't do it, then what is the workaround?
My current solution is including the lib dir in the configure command:
CFLAGS=" -arch i386" CCFLAGS=" -arch i386" CXXFLAGS=" -arch i386" LDFLAGS=" -L`pwd`/../libs/gst-plugins-base -L`pwd`/../libs/liboil -arch i386" ./configure
Is this the way to go or are the better alternatives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果安装位置不与系统库冲突,
sudo make install
就可以了。为了让构建的二进制文件找到您的库,otool
和install_name_tool
是您的朋友。对于部署,这些将允许您使所有内容都与捆绑包相关,即使它是为不同的安装位置构建的。sudo make install
will be fine, IF the installation location does not conflict with the system libraries. In order to allow the built binaries to find your libraries,otool
andinstall_name_tool
are your friends. For deployment, these will allow you to make everything bundle-relative even if it has been built for a different install location.