On 07/17/2014 12:44 PM, Dimitrios Apostolou wrote:
> Hi Erik, thank you for forwarding to the appropriate list!
> 
> On Thu, 17 Jul 2014, Eric Blake wrote:
>>
>> I don't know if automake should work around your bad syntax, or if you
>> should just fix your configure.ac to use correct syntax to begin with. I
> 
> Is my syntax illegal? Can't I put line-breaks there? If I knew I
> wouldn't bother with this patch, it's just that I consumed some time to
> figure out this failure, so I thought it would be helpful to others.

Not illegal (there's no law prohibiting it), but not typical; and the
fact that it is causing a syntax error is a sign that fixing your code
is more likely to bring it in line with other packages, than waiting for
the tools to be taught to work with your usage as a new pattern, and
then waiting for that fix to percolate to the distros you care about.

More typical usage looks like one of these:

AM_CONDITIONAL([HAVE_LIBXML2],
    [test "x$with_libxml2" != xno &&
     test "x$ac_cv_lib_xml2_xmlFirstElementChild" = xyes])

or

AM_CONDITIONAL([HAVE_LIBXML2], [
    test "x$with_libxml2" != xno &&
    test "x$ac_cv_lib_xml2_xmlFirstElementChild" = xyes]dnl
)

(that is, you'll usually see the close ) flush against the close ], or
you will see a use of 'dnl' to eat any newlines that were used to
visually spot that the closing ) on the start of the next line matches
an earlier line above)


> 
>> also wonder if automake could use AS_IF instead of open-coding the if to
>> try and take advantage of autoconf's smarts for trying to sanitize
>> conditions.
>>
>> However, even autoconf's AS_IF current implementation prefers the 'if
>> cond; then' rather than 'if cond $newline then', so it is likewise not
>> robust to conditions ending in a spurious newline.  If changing AS_IF to
>> use newline separator does not increase configure size, I could see
>> making that change in autoconf.  I'll play with the idea.
> 
> Thanks, please keep me posted!

Sure.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to