autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] Require Perl 5.10.0 or later.


From: Eric Blake
Subject: Re: [PATCH 1/5] Require Perl 5.10.0 or later.
Date: Tue, 12 Jul 2022 09:06:45 -0500
User-agent: NeoMutt/20220429-157-d20c88

On Sun, Jul 10, 2022 at 03:08:57PM -0400, Zack Weinberg wrote:
> 
> This patch also makes configure search $PATH for executables named
> ‘perl5*’ and ‘perl-5.*’ if bare ‘perl’ is too old.  To do this, it
> introduces a helper macro AClocal_PATH_PROG_GLOBS_FEATURE_CHECK, which
> I would *like* to promote to a new Autoconf feature, but I got stuck
> on quoting issues — see comments in m4/perl-time-hires.m4.
> 
> +++ b/m4/perl-time-hires.m4
> @@ -0,0 +1,74 @@
> +# perl-time-hires.m4 serial 1
> +
> +# Copyright (C) 2022 Free Software Foundation, Inc.
> +
> +# Copying and distribution of this file, with or without modification,
> +# are permitted in any medium without royalty provided the copyright
> +# notice and this notice are preserved.  This file is offered as-is,
> +# without warranty of any kind.
> +
> +# AClocal_PATH_PROG_GLOBS_FEATURE_CHECK
> +# ---------------------------------
> +# Like AC_PATH_PROGS_FEATURE_CHECK, but each of 'progs-to-check-for' may
> +# be a shell glob, which is expanded once for each path entry.
> +# That is, AClocal_PATH_PROG_GLOBS_FEATURE_CHECK([PERL], [perl-*]) will
> +# test each program named something like 'perl-*' found anywhere on the
> +# path.  Due to the syntax conflict with Autoconf string quoting,
> +# character sets (e.g. perl-[56]*) are not supported.

Will quadrigraphs help?  @<:@ and @:>@ form late expansions to [ and ]
respectively, so that you can guarantee their presence in the
configure script without munging during the rest of autoconf.

> +m4_define([AClocal_PATH_PROG_GLOBS_FEATURE_CHECK],
> +[if test -z "$$1"; then
> +  ac_path_$1_found=false
> +  # Loop through the user's path and test for each of PROGNAME-LIST
> +  dnl AS_ESCAPE has been excessively optimized and does not work for anything
> +  dnl other than constructing strings.  I have not been able to figure out 
> how
> +  dnl to get [ and ] through this process without mangling them, so
> +  dnl character sets are not supported for now.
> +  _AS_PATH_WALK([$5],
> +  [for ac_prog in m4_bpatsubst([$2], [[!?*]], [\\\&])
> +   do
> +    for ac_exec_ext in '' $ac_executable_extensions; do
> +      ac_pathglob_$1="$as_dir$ac_prog$ac_exec_ext"
> +      for ac_path_$1 in $ac_pathglob_$1; do
> +        AS_EXECUTABLE_P(["$ac_path_$1"]) || continue
> +$3
> +        $ac_path_$1_found && break 4
> +      done
> +    done
> +  done])dnl
> +  if test -z "$ac_cv_path_$1"; then
> +    m4_default([$4],
> +      [AC_MSG_ERROR([no acceptable m4_bpatsubst([$2], [ .*]) could be dnl
> +found in m4_default([$5], [\$PATH])])])
> +  fi
> +else
> +  ac_cv_path_$1=$$1
> +fi
> +])
> +

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]