配置脚本如何决定重新生成自身
当我运行 ./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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
configure
不能决定这一点:make
可以。如果configure
脚本早于configure.ac
或其包含的任何文件(以aclocal.m4
开头),则make
运行autoconf
来重建configure
。使用
aclocal
重建aclocal.m4
以及使用automake
重建各种Makefile.in
也存在类似的规则。在目标计算机上解压 tarball 后,永远不应该触发这些重建规则,因为 tarball 中所有这些文件的时间戳应该是正确的(
configure
比configure.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 theconfigure
script is older thanconfigure.ac
or any of the files it includes (starting withaclocal.m4
), thenmake
runsautoconf
to rebuildconfigure
.Similar rules exist to rebuild
aclocal.m4
usingaclocal
, and the variousMakefile.in
usingautomake
.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 thanconfigure.ac
, etc.). So if this happens, either something is bogus in your tarball (like you did not usemake dist
or preferablymake 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.