Automake version (am__api_version) hard-coded in script configuration

I am currently working on a Linux project using autotools. The code is presented in SCM (Perforce), and we have a script configuration, Makefile.am, Makefile.in - the usual autotools template. Someone recently changed Makefile.am but forgot to restore Makefile.in; when i tried to build i got this error:

WARNING: `automake-1.11' is missing on your system. You should only need it if you modified `Makefile.am', `acinclude.m4' or `configure.ac'. You might want to install the `Automake' and `Perl' packages. Grab them from any GNU archive site. cd . && /bin/bash ./config.status Makefile depfiles 

I see that the automake version is hardcoded in the script configuration (and it seems to come from aclocal.m4):

 am__api_version='1.11' 

So, I need automake-1.11 (not 1.10, not something new) to restore the Makefile.in file.

Why? Why should we be tied to a specific automake version? We are mainly building Ubuntu 14.04 where version 1.14 is installed by default. Is there any way to tell the build system to just use any version of automake? Or is it safe to remove the definition of am__api_version from aclocal.m4?

+5
source share
2 answers

The problem is that you are trying to recreate Makefile.in with a different version of autotools. This will lead to a version mismatch, since aclocal.m4 was created with a different version and is used to create the remaining files.

Instead of re-creating only Makefile.in try also re- aclocal.m4 and all remaining autostart files:

 autoreconf --force --install 
+1
source

An important question: why does someone fix am__api_versions . Most likely answer: Because automake tends to change macro arguments or even completely delete macros from the previous version. There is a section in every issue of automake ad called

WARNING: future incompatibilities!

and the other -

Deprecated features removed

You can refer to releases 1.12 , 1.13 , 1.14

Thus, configure.ac or Makefile.am may contain some macros deprecated in future releases. When you encounter this problem, you have two options. Either find out which function replaced the obsolete, or stick to one version of automake . Most developers do not consider autotools files autotools be part of the source code for projects. They just want to keep the working version and stick to the current version of am .

Please note that all distributions support older versions of automake . In ubuntu you can find:

 $ apt-cache search automake | grep automake automake - Tool for generating GNU Standards-compliant Makefiles automake1.4 - A tool for generating GNU Standards-compliant Makefiles automake1.9 - A tool for generating GNU Standards-compliant Makefiles automake1.10 - Tool for generating GNU Standards-compliant Makefiles automake1.11 - Tool for generating GNU Standards-compliant Makefiles 

This means that you can install the requested version of automake .

So, you can delete the line am__api_version='1.11' and find out which macro is out of date. You will then need to decide which of these two solutions you will follow.

0
source

All Articles