Re: rhel8 test failure confirmation?

2023-04-07 Thread Jacob Bachmeyer

Karl Berry wrote:

Hi Jacob,

The guess was the two most probable locations:  /usr/share/autoconf and 
/usr/local/share/autoconf.


Wouldn't have worked on my own system :).

Challenge accepted.  


Thanks!

if $PERL -I${autom4te_perllibdir:-$(sed -n \
  '/autom4te_perllibdir/{s/^.*|| //;s/;$//;s/^.//;s/.$//;p;q}' \
<$(command -v autom4te))} -MAutom4te::FileUtils \
 -e 'exit defined $INC{q[Time/HiRes.pm]} ? 0 : 1'; then
   # autom4te uses Time::HiRes

unfortunately we are highly restricted in what we can use in basic
automake/conf shell code (as opposed to in the tests).  Neither the
"command" command nor $(...) syntax can be used.
  


Are you sure about that?  I got a fair bit of pushback on removing 
$(...) from config.guess (where it actually is a problem because 
config.guess is supposed to identify a variety of pre-POSIX systems and 
can be run independently of configure) on the grounds that Autoconf 
locates a POSIX shell and uses it for the bulk of configure (and the 
auxiliary scripts like config.guess).  Of course, Autoconf's "find a 
POSIX shell" logic does not help DejaGnu, which installs a copy of 
config.guess and runs it with /bin/sh according to its #! line...



For the former, I think there's an autoconf/make macro to look up a
program name along PATH?


From a quick glance at the manual, that would be 
AC_PATH_PROG([AUTOM4TE], [autom4te]).



[...]
  
Would you be up for tweaking the check to use such

least-common-denominator shell stuff?
  


Let's try:

AC_PATH_PROG([AUTOM4TE], [autom4te])
if test x$autom4te_perllibdir = x; then
 autom4te_perllibdir=`sed -n \
   '/autom4te_perllibdir/{s/^.*|| //;s/;$//;s/^.//;s/.$//;p;q}' <$AUTOM4TE`
fi
if $PERL -I$autom4te_perllibdir -MAutom4te::FileUtils \
-e 'exit defined $INC{q[Time/HiRes.pm]} ? 0 : 1'; then
 ... 



The backslash-newline in the sed command was added as a precaution 
against line-wrap in email; the line could be combined.



Ordinarily Perl could not be used either, but since Automake is written
in Perl, I don't see a problem with doing so here. (If the system
doesn't have Perl, Automake won't get far.)


If the system lacks Perl, autom4te will not work either.  The proposed 
test uses Perl to determine a characteristic of a program that is 
written in Perl.  :-)



Not sure if $PERL is already
defined by the time at which this would be run, but it should be
possible to arrange with an ac prerequisite if needed.
  


That should be easy enough to rearrange, since this check must come 
/after/ the autoconf version check---the pattern is only valid since 
autoconf-2.52f, but Automake requires autoconf-2.65 or later.



-- Jacob



Re: rhel8 test failure confirmation?

2023-04-07 Thread Karl Berry
Hi Jacob,

The guess was the two most probable locations:  /usr/share/autoconf and 
/usr/local/share/autoconf.

Wouldn't have worked on my own system :).

Challenge accepted.  

Thanks!

if $PERL -I${autom4te_perllibdir:-$(sed -n \
  '/autom4te_perllibdir/{s/^.*|| //;s/;$//;s/^.//;s/.$//;p;q}' \
<$(command -v autom4te))} -MAutom4te::FileUtils \
 -e 'exit defined $INC{q[Time/HiRes.pm]} ? 0 : 1'; then
   # autom4te uses Time::HiRes

unfortunately we are highly restricted in what we can use in basic
automake/conf shell code (as opposed to in the tests).  Neither the
"command" command nor $(...) syntax can be used.

For the former, I think there's an autoconf/make macro to look up a
program name along PATH? For the latter, good old `...` suffices. (Not
sure there can be newlines in `...` though, even backslashed.)

Would you be up for tweaking the check to use such
least-common-denominator shell stuff?

Ordinarily Perl could not be used either, but since Automake is written
in Perl, I don't see a problem with doing so here. (If the system
doesn't have Perl, Automake won't get far.) Not sure if $PERL is already
defined by the time at which this would be run, but it should be
possible to arrange with an ac prerequisite if needed.

Thanks,
Karl