RFR: 8031669: (xs) Allow override of "simple required tools" in basics.m4

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Wed Jan 15 10:35:24 UTC 2014


On 2014-01-14 20:59, Mike Duigou wrote:
> On Jan 14 2014, at 10:35 , Mike Duigou <mike.duigou at oracle.com> wrote:
>
>> On Jan 14 2014, at 05:17 , Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> wrote:
>>
>>> On 2014-01-14 02:57, Mike Duigou wrote:
>>>> Hello all;
>>>>
>>>> This changeset allows overriding of the "simple required tools" which are gathered in BASIC_SETUP_FUNDAMENTAL_TOOLS macro of basics.m4 I didn't extend the override ability to every tool, instead primarily to the file manipulation and archiving tools which I need to override for a project I am working on.
>>>>
>>>> http://cr.openjdk.java.net/~mduigou/JDK-8031669/0/webrev/
>>>>
>>>> Mike
>>> I think you are partly reimplementing functionality that already exists.
>>>
>>> If you call AC_PATH_PROG(CAT, cat) and $CAT is already definied, then it will not change it. So if you call configure like this
>>> configure CAT=/usr/local/bin/meow
>>> then AC_PATH_PROG will not look for "cat", but will accept that CAT is set to /usr/local/bin/meow.
>>>
>>> I think this is your needed use case..?
>> setting CAT didn't seem to have any effect for me and was overridden by BASIC_REQUIRE_PROG without adding the [$CAT cat] list. I will check again though.
> I discovered the problem.
>
> CAT=foo sh configure
>
> will result in
>
> CAT=/usr/bin/cat
>
> (the default) whereas
>
> CAT=/usr/bin/foo sh configure
>
> will result in
>
> CAT=/usr/bin/foo
>
> (overridden) The value for CAT has to be an absolute path and not merely the name of something on the path. I'm now using
>
> CAT=`which foo`
>
> (overridden to /usr/bin/foo) and that seems to work fine.

Aha, that's interesting. Good to know. I think that behavior is broken, 
though. :( (As are many of the default behaviors of the autoconf library 
macros...) If a user specifies an override and it is not found, 
configure should complain about it and not silently ignore it. But 
fixing that is not needed for your current situation. I opened 
https://bugs.openjdk.java.net/browse/JDK-8031759 instead.

Also note that while it is possible to set actual environment variables 
like you do, configure accept arguments of the form FOO=bar, so you can 
use "configure CAT=/usr/bin/cat" instead. One benefit of using this form 
is that it is part of the actual command line, so it is actually known 
to configure, and stored as part of the executed command line, etc. 
Environmental variables are more hidden, and if I had anything to say 
about it, configure should not look at them at all. :-)

/Magnus



More information about the build-dev mailing list