Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
Not eligible to see or edit group visibility for this bug.
View Bug Activity | Format For Printing | XML | Clone This Bug
This is the simplest patch for /usr/portage/sys-devel/automake/files/am-wrapper.pl-1.8-v2 Reproducible: Always Steps to Reproduce: Run aclocal on project just now created, without aclocal.m4 and Makefile.in files. Actual Results: In this case aclocal will use old automake version 1.5 Expected Results: Even if I use AM_INIT_AUTOMAKE macro in configure.ac for specify automake version as suggests automake documentation. quote from gentoo-dev maling list Hello Dear All This patch is aimed to fix incorrect automake version detection, in case when environment variable WANT_AUTOMAKE is not specified and when files Makefile.in and aclocal.m4 do not exit. It is a common situation when aclocal is executed for the first time. Automake documentation suggests a method how a project can specify its version requirements: a macro AM_INIT_AUTOMAKE([options]) should be placed in configure.in or configure.ac. For example: AM_INIT_AUTOMAKE([1.8 gnu]) After applying our patch gentoo aclocal wrapper would first search automake version requirements in envvar WANT_AUTOMAKE, Makefile.in, aclocal.m4 and then in configure.in or configure.ac. /Best regards, Vitaly patch: [begin] --- am-wrapper.pl.original 2004-10-05 17:24:33.497323688 +0400 +++ am-wrapper.pl 2004-10-05 17:34:36.671627256 +0400 @@ -22,8 +22,10 @@ # -or- # - `Makefile.in' was generated by automake-1.8 or superior, which # specifically needs automake-1.8 -# -or_ +# -or- # - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8 +# -or- +# - configure.ac -or- configure.in contain AM_INIT_AUTOMAKE with required version # - runs automake-1.7 if it exists and... # - envvar WANT_AUTOMAKE is set to `1.7' # -or- @@ -66,13 +68,15 @@ my $file = cat_(shift); return (@versions = $file =~ /^\s*\[?AM_AUTOMAKE_VERSION\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : ''; } +sub am_version_2 { + my $file = cat_(shift); + return (@versions = $file =~ /^\s*\[?AM_INIT_AUTOMAKE\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : ''; +} sub ac_version { my $file = cat_(shift); return (@versions = $file =~ /^\s*\[?AC_PREREQ\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : ''; } - - my $binary = "$0-1.4"; my $binary_1_5 = "$0-1.5"; my $binary_1_6 = "$0-1.6"; @@ -101,14 +105,18 @@ && (($ENV{WANT_AUTOMAKE} eq '1.8') || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.8' || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.8' - || am_version('aclocal.m4') ge '1.8')) { + || am_version('aclocal.m4') ge '1.8' + || am_version_2('configure.ac') ge '1.8' + || am_version_2('configure.in') ge '1.8')) { $ENV{WANT_AUTOMAKE} = '1.8'; # to prevent further "cats" and to enhance consistency (possible cwd etc) $binary = $binary_1_8; } elsif (-x $binary_1_7 # user may not have 1.7 ... && (($ENV{WANT_AUTOMAKE} eq '1.7') || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.7' || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.7' - || am_version('aclocal.m4') ge '1.7')) { + || am_version('aclocal.m4') ge '1.7' + || am_version_2('configure.ac') ge '1.7' + || am_version_2('configure.in') ge '1.7')) { $ENV{WANT_AUTOMAKE} = '1.7'; # to prevent further "cats" and to enhance consistency (possible cwd etc) $binary = $binary_1_7; } elsif (-x $binary_1_6 # user may not have 1.6 ... @@ -116,6 +124,8 @@ || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.6' || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.6' || am_version('aclocal.m4') ge '1.6' + || am_version_2('configure.ac') ge '1.6' + || am_version_2('configure.in') ge '1.6' # Autoconf 2.53d and later need automake-1.6c, so enable 1.6 for 2.53 # and up ..... || ac_version('configure.in') gt '2.52' [end]
Created an attachment (id=41165) [details] inlined patch is not beautiful, send in as attachment
(From update of attachment 41165 [details]) Please aply to Gentoo Portage
The patch assumes that the version is the first of the options passed to AM_INIT_AUTOMAKE, right? What about simply using the most recent version as default for autoconf/automake? bug 66478 ;)
Created an attachment (id=41207) [details] fixed patch, right automake version detection in configure.in or configure.ac now
Using the most recent version as default for autoconf/automake is good idea, but it may be wrong for very old projects. Ebuilds of that projects can fix problem with using WANT_AUTO* environment variables.
*** This bug has been marked as a duplicate of 68816 ***