Re: shell or M4sugar?

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

 



On Fri, Jan 8, 2021 at 11:50 AM Andreas Kusalananda Kähäri
<andreas.kahari@xxxxxx> wrote:
> On Fri, Jan 08, 2021 at 11:23:55AM -0500, Zack Weinberg wrote:
> >
> > Using AS_CASE means you don't have to write unbalanced parentheses in
> > your configure.ac or extension .m4 file.
>
> Sorry, but case statements never require unbalanced parentheses.

Modern versions of the Bourne shell accept balanced parentheses around
case patterns, but older versions did not, and Autoconf still supports
systems that still use those older shells; the most prominent example
is Solaris 10.  See
<https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/Limitations-of-Builtins.html#index-case>.

configure.ac authors are free to decline to support systems with
shells this old, of course, but reusable macro authors probably
shouldn't.

(There's an argument for adding balanced parentheses around case
patterns to the set of features required by _AS_DETECT_BETTER_SHELL, I
wonder what other readers of the autoconf mailing list think of that
idea.)

> > Using AS_ECHO means you don't have to worry about echo interpreting
> > text to be echoed as options.
>
> printf should be preferred over echo for variable data on any Unix system

In fact, that's exactly what AS_ECHO does (starting with 2.70).  The
name is historical.

zw





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux