Automake-1.14 在 make 时失败

Automake-1.14 is failing at make

我在 Ubuntu 16.04 上按照本教程下载了 automake-1.14 ./configure 顺利通过。但是我 运行 make 的那一刻它给出了一个错误。

I actually removed automake-1.15 from linux because when I was installing protobuf 2.6.1 it says that i can't find automake-1.14. Therefore I remove automake by apt-get autoremove automake. And ran the following commands

$ wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
$ tar xvzf automake-1.14.tar.gz
$ cd automake-1.14
$ ./configure
$ make # FAIL HERE
$ sudo make install

错误如下:

anybody@anywhere:~/anyshare/automake-1.14$ make
  GEN      t/testsuite-part.am
  GEN      m4/amversion.m4
CDPATH="${ZSH_VERSION+.}:" && cd . && "/home/anybody/anyshare/automake-1.14/t/wrap/aclocal-1.14" 
Can't locate /home/anybody/anyshare/automake-1.14/bin/aclocal in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /home/anybody/anyshare/automake-1.14/t/wrap/aclocal-1.14 line 29.
Makefile:2494: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 2

显然,最初的问题——很可能是构建 Automake 的问题——是错误的表现,即软件包的基于 Autotools 的构建系统已经过时。

一般来说,基于 Autotools 的包应该与预构建的 Autotools 输出一起分发,即使从技术上讲,它们是派生文件。对于那些只是在受支持的系统上构建软件包而不是修改或移植它的人来说,这避免了将 Autotools 本身安装在构建系统上的任何需要。由基于 Autotools 的构建系统通过 make dist 构建的分发包实际上将包含它们。

默认情况下,通常情况下,基于 Autotools 的构建系统包含用于重建构建系统本身(如果它已过时)的规则。这为包维护者提供了便利。 Autoconf 有一个内置的机制来提供在配置时禁用这些规则的选项(所谓的 "maintainer mode"),尽管不是所有的包都使用它。

tar 的正常操作会保留文件时间戳,但如果您的特定 tar 无法这样做,无论是在一般情况下还是在您的特定情况下,或者如果您的文件系统的时间戳分辨率很差,那么解压缩源 tarball 可能会导致 Autotools 输出看起来已过时。在那种情况下,除非被抑制,否则重建构建系统的规则将在您 运行 make.

时触发

如果您遇到这种情况,并且程序包的 configure 脚本支持 maintainer-mode 选项,那么您可以通过包含 --disable-maintainer-mode 选项来抑制构建系统重建规则,当您configure 包裹。事后看来是 20/20,我可以自信地说这为您解决了 Protobuf 构建问题。