自动工具仅在较新时安装标头

发布于 2024-11-23 15:14:12 字数 238 浏览 5 评论 0原文

我想配置我的自动工具构建,以便标头/数据文件仅在比已安装的文件更新时才安装。

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缘字诀 2024-11-30 15:14:12

就像 William 在他的评论中提到的那样,一个干净的解决方案是在配置期间覆盖 INSTALL。

如果您不希望 make install 接触 $PREFIX 中的文件(除非需要),请使用 install -C

$ ./configure INSTALL="install -C"

如果您想避免由于标头的创建时间更改而重建目标,请使用以下命令保留文件的时间戳

$ ./configure INSTALL="install -p"

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 use install -C.

$ ./configure INSTALL="install -C"

If you you want to avoid rebuilding targets due to changed creation times of headers, preserve timestamps of files with

$ ./configure INSTALL="install -p"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文