[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PATH_PROG requires target be executable

From: Stepan Kasal
Subject: Re: AC_PATH_PROG requires target be executable
Date: Tue, 27 Nov 2007 16:23:05 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hello James,

On Mon, Nov 26, 2007 at 05:12:36PM -0500, Botte, James - James M wrote:
> I'm particularly vexed that it seems to be behaviour that changed
> between version 2.59 (that I started my development on) and 2.61 (that I
> just upgraded to because I needed the m4_foreach_w macro). FYI, I went
> back and verified that AC_PATH_PROG([BOSBOOT],bosboot) works under 2.59
> and does not under 2.61 (due to the permissions issue).

this is the most important part.  A quick glimpse to the 2.59's
lib/autoconf/programs.m4 shows that Autoconf always tried to check
whether the file is executable.  But the method has changed:

2.59 did this:

cat >conf$$.file <<_ASEOF
#! /bin/sh
exit 0
chmod +x conf$$.file

Try "test -x conf$$.file".  If it works, use "test -x" in all
AC_PATH_PROG calls, otherwise give up.

2.61 uses the following:

Try "test -x /".  If it works, use it, otherwise use a complicated
hack with parsing the ls output to see if the _owner_ can execute the

So it seems that on your platform the "test -x conf$$.file" failed,
while "test -x /" works, which causes the difference.

> [...] Am I missing something (i.e. can I turn off
> the requirement that the file be executable for AC_PATH_PROG)? Is this
> just the way Autoconf is going to work, have a nice day? Or would this
> be considered a bug?

If I'm not missing something then the "2.59 worked" is true only for
your specific platform, so it does not make sense to change the macro
so that it does not check for exec bit at all.

> Any advice would be very welcome.

As you mentioned, there was a similar request earlier this month, so
it might be useful to add a macro AC_PATH_FILE, or some such.

This should be a straightforward modification of AC_PATH_PROG, just
with the AS_EXECUTABLE_P omitted.  (You can put the modified
definition to the top of your configure.ac, with the obvious risks
resulting from using internal macros.)

What do others think?
Should AC_PATH_FILE be added to Autoconf?

And, yes, have a nice day.  :-)

Stepan Kasal

reply via email to

[Prev in Thread] Current Thread [Next in Thread]