RFR: 8044733: (xs) common/autoconf/configure script doesn't properly detect missing tools

Mike Duigou mike.duigou at oracle.com
Wed Jun 4 18:25:12 UTC 2014


I considered making the check a function but opted to do the minimal change instead. I do agree that it seems like something suitable for a function.

Mike

On Jun 4 2014, at 11:22 , pointo1d <pointo1d at gmail.com> wrote:

> Hiya Mike ,
> 
> On 03/06/14 23:36, Mike Duigou wrote:
>> Hello all;
>> 
>> This is a small changeset to fix a problem where on some platforms (Solaris and possibly others) the configure script doesn't properly detect the absence of autoconf or mercurial because which returns a string for the failure condition.
>> 
>> The recipe used was previously in hgforest.sh for it's detection of the mercurial executable.
>> 
>> issue: https://bugs.openjdk.java.net/browse/JDK-8044733
>> webrev: http://cr.openjdk.java.net/~mduigou/JDK-8044733/0/webrev
>> 
>> Mike
> 
> I thought '...because which...' was a grammatical mistake, then I realized that I should've read it as '...because which(1)...' :-)
> 
> Anyway, would there be any mileage in...
> 
> error() {
> echo "ERROR: $@ - aborting..." >&2
> exit 1
> }
> 
> check_bin() {
> case x`which autoconf 2> /dev/null | grep -v "^no $1 in"` in
> x) return ;;
> *) return x ;;
> esac
> }
> 
> run_autogen_or_fail() {
> if test "`check_bin autoconf`" = x; then
> error "Cannot locate autoconf, unable to correct situation.
> Please install autoconf and run 'bash autogen.sh' to update the generated files."
> else
> echo "Running autogen.sh to correct the situation"
> bash $conf_script_dir/autogen.sh
> fi
> }
> .
> .
> .
> check_hg_updates() {
> if test "x`check_bin hg`" != x; then
> conf_updated_autoconf_files=`cd $conf_script_dir && hg status -mard 2> /dev/null | grep autoconf`
> if test "x$conf_updated_autoconf_files" != x; then
> echo "Configure source code has been updated, checking time stamps"
> check_autoconf_timestamps
> fi
> .
> .
> else
> error "Cannot locate hg"
> fi
> .
> .
> .
> }
> 
> Note that the above also corrects what appears to be the cargo cult of multiple echo statements c/w a single cat(1) using a here document.
> 
> HTH ,
> Best rgds ,
> 
> -- 
> ​Dave Pointon FIAP MBCS
> 
> Now I saw, tho' too late, the folly of beginning a work before we count the cost and before we we judge rightly of our strength to go thro' with it - Robinson Crusoe
> 




More information about the build-dev mailing list