English 中文(简体)
check automake/autoconf version in configure script
原标题:

I m trying to edit a configure script that will execute this piece of code if it is above Automake version x.xx, and if it isn t, it executes a different piece of code.

So, I need the version to be 1.10 or above, then when it 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 assume 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 for the autoconf or automake version? Possibly both?

问题回答

It doesn t make any sense to check for the automake version at configure time. The configure script is run long after automake, and may be running on a box on which automake is not installed at all. Write your configure.ac (not configure.in) to use modern automake. The developer who runs autoconf to generate the configure script will need to have modern automake installed. The user who invokes the configure script will not need to have any of the autotools installed at all.

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 don t know how to do the same for automake.





相关问题
How to install and use libtool shared library (.lo files)?

So after I ran libtool and got out a libfoo.lo and foo.o file from my library source, how do I convert the libfoo.lo file into a normal Linux shared library, like libfoo.so.1.0.0 so I can install and ...

What s the point of aclocal?

What s the point of the aclocal script and aclocal.m4 file, in context of using autotools to configure source files? From what I read, aclocal scans macro files for macros that are later used by ...

Should config.h be made public? Conflict with Python

I am working on a C library that has SWIG bindings to Python. In my autotools configuration, I check for the gettimeofday function. I have discovered that I can t compile the Python portion of my ...

What is the proper way of including linux kernel config?

I m porting an old version of a software that is partly a linux kernel module to EL5, after doing the relevant hacks, the horrible GNU autotools mess that is used to compile the thing (no, it does ...

热门标签