使用 automake 指定要构建的 Makefile
为了工作,我被迫学习一些有关自动工具的知识,但我真的不知道自己在做什么。我们的项目通常使用 rpm 进行分发,并且我们希望从 rpm 版本中删除测试代码。为了解决这个问题,我在configure.ac中编辑了AC_OUTPUT,使其仅包含检查Makefile(如果已配置)(在它执行此操作之前)。
自从进行此更改后,automake 已停止从测试目录中的 Makefile.am 生成 Makefile.in。我想我需要某种方法来告诉 automake 生成这些 Makefile.in 文件,但我不知道该怎么做。我似乎找不到如何单独指定这一点。可以告诉我如何做到这一点或为我指明正确的方向吗?
I am forced to learn some things about autotools for my job, and I really don't know what I'm doing. Our project is often distributed using rpms, and we want to remove our test code from our rpm builds. To fix this problem, I edited AC_OUTPUT in configure.ac to only include the check Makefile if configured to do so (before it did this regardless).
Since making this change, automake has stopped generating Makefile.in from Makefile.am in the test directories. I'm thinking that I need some way to tell automake to generate these Makefile.in files, but I can't figure out how to do it. I can't seem to find how to specify this separately. Can show me how to do that or point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,为我解决这个问题的方法是使用 AC_CONFIG_FILES 而不是修补 SUBDIRS。在configure.ac 中,解决该问题的方法不是将测试目录添加到AC_OUTPUT 列表中,而是使用AC_CONFIG_FILES 包含它们。这解决了我的问题,以便:
It turns out that the way to solve this problem for me was to use AC_CONFIG_FILES instead of tinkering with SUBDIRS. In configure.ac, instead of adding the test directories to the AC_OUTPUT list, the way to resolve it was to include them using the AC_CONFIG_FILES. This solves my problem so that: