Please review: JDK-8011348 "use of which in common/autoconf/autogen.sh is not portable"

David Katleman david.katleman at oracle.com
Thu Apr 4 02:14:27 UTC 2013


On 4/2/2013 7:42 PM, Tim Bell wrote:
> All -
>
> I regret the fact that I did not test the fix for 8009988 (see below) 
> when I reviewed it.  The script as written there assumes that the 
> 'which' utility will return nothing if the command is not found.  On 
> some platforms (Solaris and Windows/Cygwin to name two), the return is 
> more like 'no autoconf-2.67 in $PATH'
>
> Please review the fix for 8011348, which restores autogen.sh to 
> platform independence.

>    46 AUTOCONF=$(which autoconf 2> /dev/null);
>    47 if test $? -ne 0; then
>    48   unset AUTOCONF
>    49 fi
The above still won't work on older Solaris releases, most S10 and earlier.

As both success and failure will result in $? being 0, if means AUTOCONF 
will be set to either

         /PATH/autoconf
  or
        no autoconf in AAA BBB CCC

I would borrow what we just came up with for hgforest.sh:

AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`"

You don't need the trailing test check then.

         Thanks
                 Dave

>
> The bug report should be visible soon at:
>   http://bugs.sun.com/view_bug.do?bug_id=8011348
>
> Webrev is here:
>   http://cr.openjdk.java.net/~tbell/8011348/webrev.00/
>
> Thanks in advance for any reviews.  Feedback welcome-
>
> Tim
>
>
> -------- Original Message --------
> Subject:     hg: jdk8/build: 8009988: build-infra: Fix configure 
> output for zip debuginfo check
> Date:     Tue, 02 Apr 2013 12:59:43 +0000
> From:     ahughes at redhat.com
> To:     jdk8-changes at openjdk.java.net, build-dev at openjdk.java.net
>
>
>
> Changeset: 15c1642967c9
> Author:    andrew
> Date:      2013-04-02 13:59 +0100
> URL:       http://hg.openjdk.java.net/jdk8/build/rev/15c1642967c9
>
> 8009988: build-infra: Fix configure output for zip debuginfo check
> Summary: No output from zip debuginfo option when default is used.
> Reviewed-by: tbell
>
> ! common/autoconf/autogen.sh
> ! common/autoconf/generated-configure.sh
> ! common/autoconf/jdk-options.m4
>
>
>
>




More information about the build-dev mailing list