Discussion:
[Swig-devel] Use AC_PATH_PROG[S] instead of AC_CHECK_PROG[S] in configure?
Vadim Zeitlin
2015-07-27 16:52:48 UTC
Permalink
Hello,

Looking at SWIG configure output, it's not terribly informative right now,
e.g.:

checking for java... java

Wouldn't it be better to replace all occurrences of AC_CHECK_PROG[S] with
AC_PATH_PROG[S] so that it outputs something like this instead:

checking for java... c:/java/jre/1.8.0_11-x64/bin/java

? I don't really see any advantage in using the CHECK version, PATH
provides more details and should IMHO be always preferred. But I might be
just insufficiently versed into autoconf lore... Does anybody know of any
reason to keep CHECKs/any objections to using PATH?

Thanks,
VZ
William S Fulton
2015-07-30 20:06:15 UTC
Permalink
Post by Vadim Zeitlin
Hello,
Looking at SWIG configure output, it's not terribly informative right now,
checking for java... java
Wouldn't it be better to replace all occurrences of AC_CHECK_PROG[S] with
checking for java... c:/java/jre/1.8.0_11-x64/bin/java
? I don't really see any advantage in using the CHECK version, PATH
provides more details and should IMHO be always preferred. But I might be
just insufficiently versed into autoconf lore... Does anybody know of any
reason to keep CHECKs/any objections to using PATH?
AC_PATH_PROG does look more useful than AC_CHECK_PROG. I'm all for
changing it if it doesn't require changing the minimum version of
autoconf. There is one caveat I can think of though. AC_PATH_PROG may
return a path which includes a space. We'd need to quote all usage of
the output. I recently did this for C# and Java, but all the other
usage would probably need doing too which sounds like a pain to do as
the quotes get swallowed up as they get passed around the makefile and
there might be a lot of them.

William

------------------------------------------------------------------------------
Vadim Zeitlin
2015-07-30 20:53:33 UTC
Permalink
On Thu, 30 Jul 2015 21:06:15 +0100 William S Fulton <***@fultondesigns.co.uk> wrote:

WSF> On 27 July 2015 at 17:52, Vadim Zeitlin <vz-***@zeitlins.org> wrote:
WSF> > Hello,
WSF> >
WSF> > Looking at SWIG configure output, it's not terribly informative right now,
WSF> > e.g.:
WSF> >
WSF> > checking for java... java
WSF> >
WSF> > Wouldn't it be better to replace all occurrences of AC_CHECK_PROG[S] with
WSF> > AC_PATH_PROG[S] so that it outputs something like this instead:
WSF> >
WSF> > checking for java... c:/java/jre/1.8.0_11-x64/bin/java
WSF> >
WSF> > ? I don't really see any advantage in using the CHECK version, PATH
WSF> > provides more details and should IMHO be always preferred. But I might be
WSF> > just insufficiently versed into autoconf lore... Does anybody know of any
WSF> > reason to keep CHECKs/any objections to using PATH?
WSF> >
WSF>
WSF> AC_PATH_PROG does look more useful than AC_CHECK_PROG. I'm all for
WSF> changing it if it doesn't require changing the minimum version of
WSF> autoconf.

I don't know when it was introduced, but I'm pretty sure that it predates
the (currently required) 2.58 by a long time. Speaking of which, I think it
would be perfectly safe to require 2.6x nowadays as 2.60 is more than 9
years old by now and even the last but one 2.68 was released almost 5 years
ago (see timestamps at http://mirror.ibcp.fr/pub/gnu/autoconf/)

WSF> There is one caveat I can think of though. AC_PATH_PROG may
WSF> return a path which includes a space. We'd need to quote all usage of
WSF> the output. I recently did this for C# and Java, but all the other
WSF> usage would probably need doing too which sounds like a pain to do as
WSF> the quotes get swallowed up as they get passed around the makefile and
WSF> there might be a lot of them.

Hmm, I didn't think about this but yes, you're right, this could be a
problem in theory. I am tempted to say that people using paths with spaces
in them deserve what they get, but I realize that this opinion might not be
shared by everybody... If you think it's important to support spaces in the
paths, then we probably indeed shouldn't do this.

Regards,
VZ
William S Fulton
2015-08-03 19:49:19 UTC
Permalink
Post by Vadim Zeitlin
WSF> > Hello,
WSF> >
WSF> > Looking at SWIG configure output, it's not terribly informative right now,
WSF> >
WSF> > checking for java... java
WSF> >
WSF> > Wouldn't it be better to replace all occurrences of AC_CHECK_PROG[S] with
WSF> >
WSF> > checking for java... c:/java/jre/1.8.0_11-x64/bin/java
WSF> >
WSF> > ? I don't really see any advantage in using the CHECK version, PATH
WSF> > provides more details and should IMHO be always preferred. But I might be
WSF> > just insufficiently versed into autoconf lore... Does anybody know of any
WSF> > reason to keep CHECKs/any objections to using PATH?
WSF> >
WSF>
WSF> AC_PATH_PROG does look more useful than AC_CHECK_PROG. I'm all for
WSF> changing it if it doesn't require changing the minimum version of
WSF> autoconf.
I don't know when it was introduced, but I'm pretty sure that it predates
the (currently required) 2.58 by a long time. Speaking of which, I think it
would be perfectly safe to require 2.6x nowadays as 2.60 is more than 9
years old by now and even the last but one 2.68 was released almost 5 years
ago (see timestamps at http://mirror.ibcp.fr/pub/gnu/autoconf/)
I just looked and 2.58 does support these, so no need to change the min version.
Post by Vadim Zeitlin
WSF> There is one caveat I can think of though. AC_PATH_PROG may
WSF> return a path which includes a space. We'd need to quote all usage of
WSF> the output. I recently did this for C# and Java, but all the other
WSF> usage would probably need doing too which sounds like a pain to do as
WSF> the quotes get swallowed up as they get passed around the makefile and
WSF> there might be a lot of them.
Hmm, I didn't think about this but yes, you're right, this could be a
problem in theory. I am tempted to say that people using paths with spaces
in them deserve what they get, but I realize that this opinion might not be
shared by everybody... If you think it's important to support spaces in the
paths, then we probably indeed shouldn't do this.
I'd like to see spaces in paths banned from all file systems. But as
that isn't going to happen, we have to think about it. The main
problem area is Windows and we are a bit unusual in using atoconf for
Windows and planning on expanding its use. I just took another look
and the quotes are actually missing for C#. Then the autoconf scripts
would need to look out for code like this:

if test "cscc" = "$CSHARPCOMPILER" ; then

and modify it to use basename. So it is a risky change and I'm not
sure it'll give us much, but neverthelessif you fancy tackling this,
then it'll be a nice to have change. Maybe something for when 3.1 is
released as we've had too many regressions in 3.0.

William

------------------------------------------------------------------------------
Loading...