Check automake / autoconf version in script configuration

I am trying to edit a script configuration that will execute this part of the code if it is higher than the version of Automake x.xx, and if not, it executes another piece of code.

So, I need the version to be 1.10 or higher, and then when that is the case, I want to do this:

m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 

And, otherwise:

 m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 

So, I would suggest that it would look something like this (in configure.in ):

 if test GET_AUTOMAKE_VERSION >= 1.10; then m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) else m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) fi 

Also, should I check the autoconf or automake version? Maybe both?

+4
source share
2 answers

It makes no sense to check the automake version during setup. The script configuration starts long after automake and can work on a box on which automake is not installed at all. Write your configure.ac (not configure.in) to use modern automake. A developer who runs autoconf to create a configure script will need to install modern automake. The user who invokes the configure script will not necessarily have any of the autotools options set.

+4
source

For testing the autoconf version, I think something like this will work.

 m4_version_prereq ( 1.10, m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]), m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) ) 

I do not know how to do the same for automake.

+1
source

Source: https://habr.com/ru/post/1299170/


All Articles