如何防止自动工具自动重新生成配置脚本?

时间:2021-09-26 07:11:35

Sometimes due to the SCM not strictly remembering the timestamp of files the generated Makefile will think that it needs to re-run "autoreconf -i" or equivalent to re-generate Makefile.in from Makefile.am, configure from configure.ac, etc..

有时由于SCM没有严格记住文件的时间戳,生成的Makefile会认为它需要重新运行“autoreconf -i”或等效于从Makefile.am重新生成Makefile.in,从configure.ac配置等等..

How do I prevent this?

我该如何防止这种情况?

I want to prevent it because it causes these problems:

我想阻止它,因为它会导致这些问题:

  • when creating a dist archive (git archive --format=tar ...) the timestamp will be incorrect and the problem will be there for end-users. Not cool.
  • 在创建dist存档(git archive --format = tar ...)时,时间戳将不正确,最终用户将面临问题。不酷。

  • On slow systems this makes the compile take a lot longer, because it's no longer configure, make, make install, but configure, autoreconf -i, configure, make make install.
  • 在慢速系统上,这会使编译花费更长时间,因为它不再配置,make,make install,而是configure,autoreconf -i,configure,make make install。

I know I can "touch" the generated files prior to making a dist tarball, but in my opinion that only solves the problem for the tarballs, not for developers. It's also an ugly hack to work around a misfeature that should just be turn-off-able. Also, it breaks git archive, since the timestamps won't always be correct there anyway.

我知道我可以在制作dist tarball之前“触摸”生成的文件,但在我看来,这只能解决tarball的问题,而不是开发人员。这也是一个丑陋的黑客,解决一个应该关闭的错误。此外,它打破了git存档,因为无论如何时间戳并不总是正确的。

Other SCMs also have this, so the problem is not (IMO) with git.

其他SCM也有这个,所以问题不是(IMO)与git。

1 个解决方案

#1


You need to look into maintainer mode - that should prevent the autoreconf step, which will fix the end-users' problems.

你需要研究维护者模式 - 这应该阻止autoreconf步骤,这将解决最终用户的问题。

Add

AM_MAINTAINER_MODE

to your configure.ac / configure.in file, then (unless you specify --enable-maintainer-mode) when you configure, you're Makefile won't contain the reconfigure rules.

在配置时,你的configure.ac / configure.in文件(除非你指定--enable-maintainer-mode),你的Makefile将不包含重新配置规则。

#1


You need to look into maintainer mode - that should prevent the autoreconf step, which will fix the end-users' problems.

你需要研究维护者模式 - 这应该阻止autoreconf步骤,这将解决最终用户的问题。

Add

AM_MAINTAINER_MODE

to your configure.ac / configure.in file, then (unless you specify --enable-maintainer-mode) when you configure, you're Makefile won't contain the reconfigure rules.

在配置时,你的configure.ac / configure.in文件(除非你指定--enable-maintainer-mode),你的Makefile将不包含重新配置规则。