Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41389 - ac-wrapper-2.pl from autoconf should test all AC_PREREQ macro calls not only the first
Summary: ac-wrapper-2.pl from autoconf should test all AC_PREREQ macro calls not only ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-12 09:17 UTC by jochen
Modified: 2004-05-27 06:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix to evalutate all AC_PRERQ macro calls (ac-wrapper-2.pl.diff,1.09 KB, patch)
2004-02-12 09:18 UTC, jochen
Details | Diff
ac-wrapper.pl (ac-wrapper.pl,2.73 KB, text/plain)
2004-03-01 11:13 UTC, Martin Schlemmer (RETIRED)
Details
ac-wrapper with my fix (ac-wrapper.pl,2.71 KB, text/plain)
2004-03-10 07:16 UTC, jochen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2004-02-12 09:17:49 UTC
Basically what the summary says. Some packages have several AC_PRERQ macro calls in aclocal.m4 where the first only requires 2.1 but another requires 2.5

See attached patch about how to fix this.. it just gets all calls and takes the (stringwise) largest number

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 jochen 2004-02-12 09:18:58 UTC
Created attachment 25486 [details, diff]
fix to evalutate all AC_PRERQ macro calls
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-15 14:31:47 UTC
The test was actually wrong (did not catch '(?.??)' ..) .  Please try
autoconf-2.59-r1, or provide a test package which it fails for, so that
I can have a look.
Comment 3 jochen 2004-02-15 23:12:06 UTC
nopes, still doesn't work.

the new ac-wrapper-2.pl still doesn't evaluate all AC_PREREQ calls.

for example net-irc/irssi-cvs has to select the autotools versions explicitly because of this.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-19 11:46:32 UTC
Works fine here:

--
nosferatu irssi # grep AC_PRE *
aclocal.m4:[AC_PREREQ([2.12])
aclocal.m4:[AC_PREREQ(2.50)dnl
configure:# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
configure:# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
configure:# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
configure:# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
nosferatu irssi # set | grep AUTO
nosferatu irssi # ./autogen.sh
Creating help files...
Documentation: html -> txt...
Checking auto* tools...
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.
 
Running libtoolize...
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
Running aclocal  -I . ...
Running autoheader...
autoheader-2.59: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader-2.59: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader-2.59: WARNING: is deprecated and discouraged.
autoheader-2.59:
autoheader-2.59: WARNING: Using the third argument of `AC_DEFINE' and
autoheader-2.59: WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
autoheader-2.59: WARNING: `acconfig.h':
autoheader-2.59:
autoheader-2.59: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader-2.59:                [Define if a function `main' is needed.])
autoheader-2.59:
autoheader-2.59: WARNING: More sophisticated templates can also be produced, see the
autoheader-2.59: WARNING: documentation.
configure.in:18: warning: AC_ARG_PROGRAM invoked multiple times
Running autoconf ...
configure.in:18: warning: AC_ARG_PROGRAM invoked multiple times
Running automake --gnu  ...
Running ./configure --enable-maintainer-mode --enable-compile-warnings ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... found
checking for working autoconf... found
Comment 5 jochen 2004-02-20 04:21:20 UTC
hum, indeed. irssi works again... just upgraded to -r3

let me give you a shorter example:

$ cat > configure.in <<EOF
AC_INIT(configure.in)
AC_PREREQ([2.1]);
AC_PREREQ([2.5]);
EOF
$ autoconf
$ ./configure --version
configure generated by autoconf version 2.13
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2004-03-01 11:13:04 UTC
Created attachment 26671 [details]
ac-wrapper.pl

Ok, I wanted to rather add it via function.  I however suck at perl, so
cannot see why it does not work properly :/  Any ideas?
Comment 7 jochen 2004-03-01 11:37:43 UTC
It should read something like

sub ac_version {
        return ((@versions = cat_(shift) =~ /^\s*\[?AC_PREREQ\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : '');
}

you got the assignment wrong. It's not @versions = cat_(shift) but @versions = (cat_(shift) =~ ... ) The match operator returns an array ($1, $2, $3, $4, ...) which is assigned to @versions.

alternativly you could write something like

my $file = cat_(shift);
return ((@versions = $file =~ ...
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2004-03-01 11:47:45 UTC
I did try adding the cut_() inbetween.  It seems rather its the return
that causes issues for some reasons.  Maybe because of the '.' in what is
returned?
Comment 9 jochen 2004-03-10 07:16:58 UTC
Created attachment 27157 [details]
ac-wrapper with my fix

sorry for the long delay.

I modified the ac-wrapper as I described above, and it works for me.

could you please provide a short counter-example were it doesn't?
Comment 10 Caleb Tennis (RETIRED) gentoo-dev 2004-05-27 06:39:48 UTC
I've committed this to ac-wrapper-4 which is used in autoconf-2.59-r4.