问题
I've got a large project on my hand (master) that is split into several components (liba, b, c, d) to ease building and maintenance. When building the whole package, all of the subcomponents must be built in sequence, and some of these packages depend upon each other.
In more explicit terms, liba is a prerequisite for b, c and d, and the presence of liba is checked by the configure script. This check is definitely necessary to give user-friendly error messages when building the b distribution on its own. However, when building the master package and all its subpackages, liba is built as a subtarget. Therefore, when configure runs on the master suite, liba is not installed yet and the check for liba in b fails.
I could rectify this issue by passing a --with-liba=internal or similar flag to the configure script of b; however, I haven't found any documentation on such flag-passing for autoconf. For the time being, I have a long, long custom Makefile in master that does just the same as autoconf/automake with subdirectories, but reorders dependencies a bit so that instead of (configure liba) => (configure b) => (build liba) => (build b), the order is (configure liba) => (build liba) => (install liba) => (configure b) => (build b).
Any idea how I could refactor this with standard autoconf/automake subdirectories?
回答1:
This mail might help.
来源:https://stackoverflow.com/questions/7552845/autoconf-subdirectories-with-subpackages-depending-on-each-other