diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-11-07 23:47:32 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-11-07 23:47:32 +0000 |
commit | 14019c2fb105c1d377200b139ede9ab6729e9c9b (patch) | |
tree | 8bcffb3fabf15421599ac13bc5198c6880e51a1c | |
parent | update ac-wrapper.pl to work with AC_PREREQ in [] (diff) | |
download | autotools-wrappers-14019c2fb105c1d377200b139ede9ab6729e9c9b.tar.gz autotools-wrappers-14019c2fb105c1d377200b139ede9ab6729e9c9b.tar.bz2 autotools-wrappers-14019c2fb105c1d377200b139ede9ab6729e9c9b.zip |
Update version closing bug #32830. Change to automake's style of selecting
version, closing bug #31016.
-rwxr-xr-x | ac-wrapper.pl | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/ac-wrapper.pl b/ac-wrapper.pl index 86797ef..561cea3 100755 --- a/ac-wrapper.pl +++ b/ac-wrapper.pl @@ -17,7 +17,7 @@ # # - defaults to autoconf-2.13 # - runs autoconf-2.5x if it exists and... -# - envvar WANT_AUTOCONF_2_5 is set to `1' +# - envvar WANT_AUTOCONF is set to `2.5' # -or- # - configure.ac is present # -or- @@ -38,19 +38,30 @@ sub cat_ { local *F; open F, $_[0] or return; my @l = <F>; wantarray ? @l : join my $binary = "$0-2.13"; my $binary_new = "$0-2.5x"; -if (!$ENV{WANT_AUTOCONF_2_1}) { - if ((! -x $binary) # handle stuff like autom4te, where only 2.5x have the binary +# Autoconf is really getting out of hand, so rather start supporting +# WANT_AUTOCONF = "2.5" the like. Unfortunately it override the old +# variables, so if not set, just convert the old variables .... +if ($ENV{WANT_AUTOCONF} eq "") { + if ($ENV{WANT_AUTOCONF_2_1}) { + $ENV{WANT_AUTOCONF} = '2.1'; + } elsif ($ENV{WANT_AUTOCONF_2_5}) { + $ENV{WANT_AUTOCONF} = '2.5'; + } +} + +if ($ENV{WANT_AUTOCONF} ne '2.1') { + if ((! -x $binary) # handle stuff like autom4te, where only 2.5x have the binary || (-x $binary_new # user may have only 2.13 - && ($ENV{WANT_AUTOCONF_2_5} + && (($ENV{WANT_AUTOCONF} eq '2.5') || -r 'configure.ac' || (cat_('configure.in') =~ /^\s*\[?AC_PREREQ\(\[?([^\)]{3})[^\)]*\]?\)/m ? $1 : '') gt '2.1' || (cat_('configure') =~ /^# Generated by Autoconf (\S+)/m ? $1 : '') gt '2.1' || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.6' || (cat_('aclocal.m4') =~ /^\s*\[?AC_PREREQ\(\[?([^\)]{3})[^\)]*\]?\)/m ? $1 : '') gt '2.1'))) { - $ENV{WANT_AUTOCONF_2_5} = 1; # to prevent further "cats" and to enhance consistency (possible cwd etc) - $binary = $binary_new; + $ENV{WANT_AUTOCONF} = '2.5'; # to prevent further "cats" and to enhance consistency (possible cwd etc) + $binary = $binary_new; } else { - $ENV{WANT_AUTOCONF_2_1} = 1; # for further consistency + $ENV{WANT_AUTOCONF} = '2.1'; # for further consistency } } |