Re: Autoconf Transforms

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

 



Hi Tom,

* Tom Browder wrote on Tue, Oct 14, 2008 at 10:24:58PM CEST:
> I am trying to use some raw shell commands in my 'configure.ac' file
> and find that some constructs are not permitted without some care,
> e.g., regex classes, where 's/[^0-9]//' becomes 's/^0-9//' unless one
> doubles the square braces like so 's/[[^0-9]]//' in which case one of
> each pair is stripped away to get the desired form in the resulting
> 'configure' file.  But that may not be the correct way to handle it.

It's a valid way.  You can move the quotes outward:

$some_normal_code
[ $double_quoted_code
  ..
  sed 's/[^0-9]//' ...
  $more_double_quoted_code
]
$more_normal_quoted_code

and likewise use double [[...]] quoting inside macro arguments.

But this will only work with matched brackets.  You can alternatively
use quadrigraphs @<:@ @:>@  which also works for unmatched brackets.

As yet another alternative, one can use changequote.  Please avoid that,
though.

> I guess the manual is trying to tell me that implicitly by discussing
> the m4 processor parsing rules, but I haven't yet found an explicit
> warning to that effect about use of shell commands (except the
> warnings about portable shell programming and recomended non-use of
> the negated character class form).

Not sure where you expect the warning?

> Are there more such constructs I should be on the lookout for?  Have I
> missed somthing in the manual?

Dunno.  As configure.ac code is parsed by m4 (with most builtins
redefined), roughly all pitfalls of m4 apply.  The important ones
are AFAIK explained in the Autoconf manual.  But it certainly should
not hurt to look at the M4 manual.  ;-)

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

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

  Powered by Linux