views:

48

answers:

1

I am going to be creating a "library of libraries" and would like each individual project to be managed using autotoolset. In addition, I would like to be able to build the whole set of libraries at the same time.

Individual libraries:

  • libyarconveniencezzz
  • libyarfoo
  • libyarbar
  • libyarbaz

I suspect that I might need to just have a top level Makefile written by hand and then have each individual library/convenience library be its own autotoolset package.

I have done something similar to this (four or five years ago) but I have lost my reference code. About the only thing I really remember was taking several months fumbling around in autotools before getting everything setup like I wanted.

A: 

I use the following code to build several autotools-managed packages (though they all create "normal" binaries rather than a "library of libraries"):

configure.ac:

AC_INIT(bigpackage, 1.0, [email protected])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES(Makefile)
AC_CONFIG_SUBDIRS([package1 package2 package3])
AC_OUTPUT

Makefile.am:

SUBDIRS = package1 package2 package3

Then all this can be set up as usual:

touch NEWS README AUTHORS ChangeLog
autoreconf -i
./configure
make

I wouldn't necessarily call it the "best way", but it works and nicely passes all flags to the subpackages.

Niels Lohmann