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 += [EMAIL PROTECTED]@/include
> AM_LDFLAGS = [EMAIL PROTECTED]@/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