如何让 automake、libtool 和 rpmbuild 协同工作
我正在尝试为我的包创建 RPM,该包是使用 automake
和 libtool
构建的,但我遇到了一个问题:rpmbuild
发现包的已安装程序包含包的共享库的安装目录的路径名时中止(由于 automake
使用了 -rpath
选项ld
)。
据我所知,rpmbuild 这样做是为了保证包是可重定位的。我的问题是该怎么办。我可以消除可共享库的使用(并失去它们的好处),或者我可以告诉 automake 不要安装可共享库(这将阻止它使用 -rpath 选项) )然后无论如何都安装它们。后一个选项的成本是它要求用户始终拥有正确设置的LD_LIBRARY_PATH
环境变量——而且它看起来有点混乱。
还有其他选择吗?
你会怎么办?
I'm trying to create an RPM of my package, which is built using automake
and libtool
, and I've encountered a problem: rpmbuild
aborts upon discovering that the installed programs of the package contain the pathname of the installation directory for the package's sharable libraries (due to automake
's use of the -rpath
option of ld
).
I understand that rpmbuild
does this in order to guarantee that the package is relocatable. My question is what to do about it. I could eliminate the use of sharable libraries (and lose their benefits) or I could tell automake
to not install the sharable libraries (which would stop it from using the -rpath
option) and then install them anyway. The cost of this latter option is that it would require that the user always have a correctly-set LD_LIBRARY_PATH
environment variable -- plus it seems like a bit of a kludge.
Is there another option?
What would you do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其详细信息取决于特定包的构建系统及其使用的 libtool 版本。
以下是 Fedora 的相关打包指南:http://fedoraproject.org/wiki/PackagingGuidelines#Beware_of_Rpath
这是来自 Debian 的类似页面: http://wiki.debian.org/RpathIssue
维基百科还有一些相关链接:http://en.wikipedia.org/wiki/Rpath_(linking)
因此,您需要尝试一些建议的技术来摆脱 rpath,但哪一种有效取决于关于具体情况您的包裹。
The details of this depend on the particular package's build system and which libtool version it is using.
Here are the relevant packaging guidelines from Fedora: http://fedoraproject.org/wiki/PackagingGuidelines#Beware_of_Rpath
Here is the analogous page from Debian: http://wiki.debian.org/RpathIssue
Wikipedia also has some relevant links: http://en.wikipedia.org/wiki/Rpath_(linking)
So you will need to try a few of the suggested techniques for getting rid of the rpath, but which one will work depends on the specifics of your package.