Thank you very much. The information is very helpful. I have solved the problem by using AC_SUBST.
Ting > Date: Fri, 17 Sep 2010 22:07:00 +0200 > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: transport conditionals to other files (was: (no subject)) > > Hello Ting, > > * ting xie wrote on Thu, Sep 16, 2010 at 10:23:45PM CEST: > > How are you? It is quite a long time since we talked last time. > > Yes. I'm just fine, thanks! (There are many other helpful readers > on this list, by the way ...) > > > I got a new question about autoconf now. Suppose I have defined a > > conditional variable in configure.ac file as follows. > > > > AM_CONDITIONAL([FOO], [test x$foo = xtrue]) > > > > I have another file test.inc.in file, if I want to put the condition > > foo into this .inc.in file, how can I do that? > > Hmm, you cannot put the condition into another file right away, as for > one, the shell variable $foo will not have any meaning there. However, > if the file is instantiated by config.status (i.e., config.status reads > FILE.inc.in and produces FILE.inc from it), then you can use a > substituted variable; put AC_SUBST([foo]) in configure.ac, and @foo@ in > FILE.inc.in, and it will get replaced with the value of $foo. > > > BTW, I do not understand this kind of postfix .inc.in file. May you > > also give me some explanation on this kind of files if you have time? > > The .in postfix usually indicates that this file is read by > config.status to create a file without the .in postfix; see > info Autoconf "Configuration Files" > > for more information. > > Hope that helps. > > Cheers, > Ralf
