[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why my AT_CHECK() can't work?
From: |
Eric Blake |
Subject: |
Re: Why my AT_CHECK() can't work? |
Date: |
Thu, 10 Aug 2017 08:40:18 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/09/2017 09:56 PM, Sam wrote:
> Yes, it's because a space at the end of line:
>
> --- -^I2017-08-10 10:51:06.097868811 +0800$
>> +++
> but in my match, I add a space, I don't know why it doesn't work.
>
> AT_CHECK([[awk '/ACTIVE/' stdout | head -4]], [0], [LACP actor_state ACTIVE
>> AGGREGATION SYNC COLLECTING DISTRIBUTING $
>> partner_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
>> LACP actor_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
>> partner_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
>> ])$
Because autoconf eats trailing spaces by default (it's a feature). You
can work around it by TELLING autoconf that you intend for there to be
trailing space:
AT_CHECK(..., [[trailing space preserved here: @&t@
but not here
more text]])
The @&t@ quadrigraph (mnemonic 'and-t' sounds similar to 'empty')
expands to nothing, but is converted after the point when trailing
whitespace is eaten.
The manual documents this:
https://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Zack Weinberg, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?,
Eric Blake <=
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/17
- Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/18
Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/09