[Top][All Lists]

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

Re: automake and autoconf

From: Gary V . Vaughan
Subject: Re: automake and autoconf
Date: Fri, 1 Jun 2001 22:16:56 +0100

On Thursday 31 May 2001  7:47 pm, Dan Miner wrote:
> Hello,

Hello Dan,

> I've been reading the autoconf book and I find it quite useful; however,
> I've hit a wall and can't seem to wrap my head around it.

Glad you like the book.

> Quick layout
> proj/
> proj/
> proj/lib1/
> proj/lib1/src/
> etc.
> I am retrofitting a company project to use these tools (and my first try at
> using these tools).  I have *very* simple macros defined for gathering
> paths to "third-party" libraries and simple thread library checking.
> However, I need to define _REENTRANT in the of each */src
> directory.  I would like to define this in the top level
> (proj/
> When I try this (using AC_SUBST to "export" to the others), I find there
> variable has not retained its value.
> Is there any way to "export" an variable defined in automake down to deeper
> levels?  Do I just use make's .export or the autoconf cache?

I am not sure I understand what it is that you are trying to do, but it 
sounds as though you are trying to get the Makefiles to do autoconf's job.  
Or perhaps you are using CPPFLAGS (which is for your users to set at compile 
time), instead of AM_CPPFLAGS?

If this is something that you want your users to determine, then they can 
simply build the project with:


Alternatively you can add that flag to each as follows:


Or if you want to set it conditionally based on tests at configure time, then 
you should add this to (before the final AC_OUTPUT):

        if test $ac_cv_my_reentrancy_test_result" = xyes; then

Having done that, to make the substitution happen in the Makefiles, you would 
add the following to each


Finally, if you want to have some boilerplate read by each sub-makefile, you 
could have a Make.Rules file in the top of the source tree (containing the 
line above, plus any other stuff you want copied to every Makefile), and then 
add this line to each that needs the boilerplate:

        include $(top_srcdir)/Make.Rules

Hopefully, some or all of this relates to the problem you are describing...

  ())_.  Gary V. Vaughan     gary@(|
  ( '/   Research Scientist        ,_())____
  / )=   GNU Hacker   \'      `&
`(_~)_   Tech' Author    =`---d__/

reply via email to

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