autoconf
[Top][All Lists]
Advanced

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

Re: Arrays in configure.ac


From: John Calcote
Subject: Re: Arrays in configure.ac
Date: Thu, 08 Jul 2010 23:23:14 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5

Hi Sammy,

On 7/8/2010 10:48 PM, Sam Silla wrote:
> Hello,
>
> I would like to create an array of values to use in configure.ac and am
> unsure what the best way to accomplish this is. I was wondering if Autoconf
> comes with native support for constructing and iterating through arrays.

You have to remember that autoconf configure.ac files are just bourne
shell scripts with M4 macro calls mixed in. You can do anything in
configure.ac that you can do in a bourne shell script. While many folks
use linux and bash these days, and bash has built-in support for arrays,
standard bourne shell only has very basic support for array syntax. In
fact, it only has one array - the command line parameter array. But
various forms of homebrew array syntax can be used.

So... let me google that for you:

     http://lmgtfy.com?q=bourne+shell+arrays

Sorry, I couldn't resist. I recently discovered lmgtfy.com. As sarcastic
as it is, I find it rather funny.

If you're willing to forgo portability (which I highly discourage), then
you can certainly use bash array syntax in your scripts.

Regards,
John





reply via email to

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