autoconf
[Top][All Lists]
Advanced

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

Re: Dynamically creating output variables.


From: Ralf Wildenhues
Subject: Re: Dynamically creating output variables.
Date: Wed, 16 Jan 2008 19:12:13 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Craig,

Let's keep the list in the game, please.

* Craig Sanders wrote on Wed, Jan 16, 2008 at 02:06:23PM CET:
> 
> Thankyou for your response. I envisage that the set of keys will be
> known and fixed prior to the point in time at which autoconf will be
> run. So if I understand correctly what it is that you are alluding to,
> then I should be able to scan through my package's configuration file
> and extract the necessary values, which can then be passed to
> corresponding calls to AC_SUBST which have had their first argument
> hard wired. Thankyou. I didn't think of doing it that way!

You can separate the setting of variables and the announement of
AC_SUBST.  These three are all equivalent:
  AC_SUBST([var], [$value])

  var=$value
  AC_SUBST([var])

  AC_SUBST([var])
  var=$value

so if you have a set of variables known at autoconf time, you can
do the substitution announcement like this:

  m4_foreach(Varname, [var1, var2, var3, var4],
    [AC_SUBST(Varname)])

and just take care to set $var1, $var2, ..., someplace in configure.

Cheers,
Ralf




reply via email to

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