autoconf
[Top][All Lists]
Advanced

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

Re: comma separated lists


From: Peter Eisentraut
Subject: Re: comma separated lists
Date: Mon, 13 Jan 2003 22:17:23 +0100 (CET)

Bruno Haible writes:

> This advantage that you mention is not visible to the user. (I don't
> care about one or two percent of speed in autoconf execution.)

The difference between space-separated lists and comma-separated lists is
approximately like writing in C func("arg1 arg2 arg3") rather than
func(arg1, arg2, arg3).  It is not "proper" for the language being used.
It is a historical mistake that is being phased out.  The new style will
make the system more robust, which is not immediately visible to user, of
course, but ultimately for his benefit.

> Whereas the second disadvantage of comma-separated lists is that it
> doesn't support computing the list at configure time:
>
> funcs="malloc, free, foobar"
> AC_CHECK_DECLS([$funcs])
>
> funcs="getenv foobar"
> AC_CHECK_DECLS([$funcs])
>
> Doesn't work!

This approach is already dysfunctional right now, because if you write it
that way it's not traceable and autoheader and other tools that depend on
tracing, such as automake, will screw up.  There is an easy fix.  You can
write

if condition1; then
AC_CHECK_DECLS(getenv)
fi

if condition2; then
AC_CHECK_DECLS(foobar)
fi

-- 
Peter Eisentraut   address@hidden





reply via email to

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