automake
[Top][All Lists]
Advanced

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

Re: any way to set AM_CPPFLAGS for all subdirs at one time?


From: Ralf Wildenhues
Subject: Re: any way to set AM_CPPFLAGS for all subdirs at one time?
Date: Sat, 25 Nov 2006 10:56:42 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Ed,

* Ed Hartnett wrote on Thu, Nov 23, 2006 at 04:15:17PM CET:
> 
> In my build, I allow the user to specify a location for a library, in
> case they have built the library but not installed it in /usr/lib, or
> some other place the loader checks automatically. The library is
> called HDF5, and the configure script allows them to do something
> like:
> 
> ./configure --with-hdf5=/some/dir
> 
> Then in each of my subdirs, I have the following in my Makefile.am
> files: 
> 
> # If the user specified a root for HDF5, use it.
> if USE_HDF5_DIR
> AM_CPPFLAGS += address@hidden@/include
> AM_LDFLAGS = address@hidden@/lib
> endif
> 
> Is there a way to do this in one place for all subdirs? Or must this
> be done in each directory's Makefile.am?

You could set it in configure.ac:
  AC_SUBST([AM_LDFLAGS], ["-L$HDF5DIR/lib"])

Or, if you need more stuff in that variable, substitute another
variable, say HDF5CPPFLAGS, and then just
  AM_CPPFLAGS = $(HDF5CPPFLAGS) $(OTHER_CPPFLAGS) ...

in each Makefile.am.

Or use an file snippet you include in every other Makefile.am to put
such changes in.

There's really many choices here, you can pick what suits you best.

Cheers,
Ralf




reply via email to

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