[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Transferring variables from configure.ac to Makefile.am
From: |
Nick Bowler |
Subject: |
Re: Transferring variables from configure.ac to Makefile.am |
Date: |
Thu, 24 Mar 2016 15:52:24 -0400 |
Hi Russell,
On 3/24/16, Russell Wallace <address@hidden> wrote:
> I think I sort of see how to set variables within configure.ac, and do some
> minimal calculations on them. But how do you transfer the value of a
> variable set in configure.ac, to Makefile.am where it will be actually
> used?
Any shell variable can be marked as an "output variable" by using AC_SUBST;
the value is then substituted into configure outputs. See "Setting Output
Variables"[1] in the Autoconf manual for the details.
It sounds like you are using Automake so this process should be pretty much
automatic: by default, automake automatically adds the appropriate magic to
set make variables with the same name, so you can just use the variable in
make as you normally would.
Example:
configure.ac:
FOO=bar
AC_SUBST([FOO])
Makefile.am:
my_stuff = $(FOO)
[1]
https://www.gnu.org/software/autoconf/manual/autoconf.html#Setting-Output-Variables
Cheers,
Nick