配置脚本如何决定重新生成自身

发布于 2024-10-01 05:45:02 字数 179 浏览 1 评论 0原文

当我运行 ./configure 有时它会认为它太旧并通过丢失的脚本重新运行 autoconf 以重新生成自身。有时它会导致奇怪的破坏,因为 autoconf 打开 目标机器比最初生成配置的 autoconf 更旧。

我想知道它是如何发现它太旧的?配置有标准方法可以做到这一点吗?或者这取决于图书馆。指向文档的指针将 受到赞赏。

When I run ./configure sometimes it decides that it's too old and re-runs autoconf through missing script to regenerate itself. Sometimes it leads to weird breakages since autoconf on
the target machine is older then autoconf that was used to originally generate configure.

I was wondering how it figures out that it's too old? Is there a standard way for configure to do that? or it depends on the library. Pointers to documentation would
be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

2024-10-08 05:45:02

configure 不能决定这一点:make 可以。如果 configure 脚本早于 configure.ac 或其包含的任何文件(以 aclocal.m4 开头),则 make 运行 autoconf 来重建 configure

使用 aclocal 重建 aclocal.m4 以及使用 automake 重建各种 Makefile.in 也存在类似的规则。

在目标计算机上解压 tarball 后,永远不应该触发这些重建规则,因为 tarball 中所有这些文件的时间戳应该是正确的(configureconfigure.ac 等)。因此,如果发生这种情况,要么是您的 tarball 中存在虚假内容(例如您没有使用 make dist 或最好使用 make distcheck 来生成它),要么是用户编译了源代码做错了什么(比如复制整个目录而不保留时间戳),或者目标系统中有一些虚假的东西(例如,如果时钟的时钟,make通常无法在NFS安装的目录上正常工作NFS 服务器与客户端不同步)。

将生成的文件保存在版本控制系统中的人观察到了不受欢迎的重建的另一个常见来源。请参阅 https://www.gnu.org/software/automake/manual /html_node/CVS.html 有关此问题的讨论(如果您属于这种情况)。

configure does not decide this: make does. If the configure script is older than configure.ac or any of the files it includes (starting with aclocal.m4), then make runs autoconf to rebuild configure.

Similar rules exist to rebuild aclocal.m4 using aclocal, and the various Makefile.in using automake.

These rebuild rules should never be triggered after you unpack a tarball on a target machine, because the timestamp of all these files in the tarball should be correct (configure newer than configure.ac, etc.). So if this happens, either something is bogus in your tarball (like you did not use make dist or preferably make distcheck to generate it), or the user compiling the source code did something wrong (like copying the entire directory without preserving the timestamps), or there is something bogus in the target system (e.g. make usually fail to work properly on a NFS-mounted directory if the clock of the NFS-server is not synchronized with that of the client).

Another frequent source of unwelcome rebuilt is observed by people who keep the generated files in version-control system. See https://www.gnu.org/software/automake/manual/html_node/CVS.html for a discussion about this if that is your case.

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