简体   繁体   English

在64位Snow Leopard上处理32位代码?

[英]Dealing with 32-bit code on Snow Leopard 64-bit?

I would like to create an XPCOM plugin for a XULRunner application that I'm building. 我想为正在构建的XULRunner应用程序创建XPCOM插件。 Since Mozilla only provides a 32-bit build of the XULRunner SDK I have to link with 32-bit libraries. 由于Mozilla仅提供XULRunner SDK的32位版本,因此我必须链接到32位库。 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? 我可以为32位版本进行sudo make install吗? 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: 我当前的解决方案是在configure命令中包含lib dir:

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? 这是走的路还是更好的选择?

sudo make install will be fine, IF the installation location does not conflict with the system libraries. 如果安装位置与系统库不冲突,则sudo make install会很好。 In order to allow the built binaries to find your libraries, otool and install_name_tool are your friends. 为了允许内置的二进制文件找到您的库, otoolinstall_name_tool是您的朋友。 For deployment, these will allow you to make everything bundle-relative even if it has been built for a different install location. 对于部署,即使已为其他安装位置构建了捆绑包,也可以使用这些包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM