Dear Autoconf maintainers,
I just wanted to say that I found a work-around for this problem:
http://git.savannah.gnu.org/cgit/gnuastro.git/commit/?id=f0a4d1eec72ae
In short, at the start of the configure script, I remove all occurances
of the current directory from `PATH'.
The root of the problem before was that the PATH of these users
contained the current directory (one as `.' and the other as `./', this
lead to the different names of `./libtool' and `.//libtool'). So I
thought correcting the PATH would be a more fundamental solution to this
particular problem.
But generally, even though this particular problem is fixed, it may be
good if multiple names could be given to `[REJECT]' in `AC_CHECK_PROG'
(a shell loop).
Thank you very much for all the hardwork on this vital package,
Cheers,
Mohammad
On 12/11/2017 05:19 PM, Mohammad Akhlaghi wrote:
Hi Autoconf maintainers,
In the `configure.ac' of GNU Astronomy Utilities (Gnuastro), I need to
check if `libtool' is present on the system or not (independent of the
libtool that is shipped with Gnuastro and is used for its internal
building) [P.S1]. Therefore, I use
AC_CHECK_PROG(has_libtool, libtool, [yes], [no])
Recently a user reported that while they didn't have libtool on their
system, this test had passed. From `config.log', I could see that it had
found (`.//libtool'). Upon further investigation, I found out that it
was because his PATH included the current directory and for some reason,
it was finding Gnuastro's internally built Libtool [P.S2].
So I updated the command above to this:
AC_CHECK_PROG(has_libtool, libtool, [yes], [no], , .//libtool)
But today, another user reported a similar problem and when I looked at
their `config.log' I found out that on that system, it had found
`./libtool'! So I changed the command to this:
AC_CHECK_PROG(has_libtool, libtool, [yes], [no], , .//libtool ./libtool)
But looking at the configure script, I noticed that the last argument to
AC_CHECK_PROG must only be a single file, not multiple. The only
solution that I have come up with so far is call it two times like below.
AC_CHECK_PROG(has_libtool, libtool, [yes], [no], , ./libtool)
AC_CHECK_PROG(has_libtool, libtool, [yes], [no], , .//libtool)
I wanted to consult you on the best way forward.
I also wanted to see if it would be possible to allow the last argument
to AC_CHECK_PROG to accept multiple file names, not just one? In this
way, a form like my first try would work and it would also be much more
efficient.
Thank you very much,
Mohammad
P.S1. Libtool is necessary for one of Gnuastro's programs to work:
BuildProgram (see link below). After installation, it uses the user's
system's libtool to fix complications with include file and library
directories. The description is given here:
https://www.gnu.org/software/gnuastro/manual/html_node/BuildProgram.html
P.S2. Gnuastro does come with its own implementation of libtool (built
from `libtool.m4). But it is strange that the configure script has found
libtool in the current directory. Because at least on my system, the
configure script builds `libtool' from `libtool.m4' after all the checks
not before it. But any way, this is besides the main point here.
--
Postdoctoral research fellow,
Centre de Recherche Astrophysique de Lyon (CRAL),
Observatoire de Lyon. 9, Avenue Charles André,
Saint Genis Laval (69230), France.