自动工具仅在较新时安装标头
我想配置我的自动工具构建,以便标头/数据文件仅在比已安装的文件更新时才安装。
在 Linux 上,makefile 为 INSTALL = /usr/bin/install,在 Solaris 上 INSTALL = install-sh。两者都采用 -C 参数来执行我想要的操作,但我没有看到任何 AC_PROG_INSTALL 或其他宏的示例来显示如何将其配置为使用 -C。
是否有一种优雅的方法,或者我会导致一些丑陋的结果?
I want to configure my autotools build so header/data files only get installed when they are newer than a file already installed.
On Linux, makefiles get INSTALL = /usr/bin/install, on Solaris INSTALL = install-sh. Both take a -C parameter that should do what I want, but I don't see any examples of AC_PROG_INSTALL, or other macro, that show how this gets configured to use the -C.
Is there an elegant method, or do I result to something ugly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就像 William 在他的评论中提到的那样,一个干净的解决方案是在配置期间覆盖 INSTALL。
如果您不希望
make install
接触$PREFIX
中的文件(除非需要),请使用install -C
。如果您想避免由于标头的创建时间更改而重建目标,请使用以下命令保留文件的时间戳
Like William mentioned in his comments, a clean solution is to overwrite INSTALL during configure time.
If you do not want
make install
to touch the files in$PREFIX
unless needed useinstall -C
.If you you want to avoid rebuilding targets due to changed creation times of headers, preserve timestamps of files with