STAR_DECLARE_DEPENDENCIES(type, deplist, [option=''])
Declare dependencies of this
component. The
TYPE
is one of `sourceset', `build', `link',
`configure', `use' or `test', and the DEPLIST
is a space separated list of component names, which this
component depends on in the specified way.
This is less complicated than it seems. The only types you're likely to have to specify are `build' and `link' dependencies.
configure.ac
should contain
STAR_DECLARE_DEPENDENCIES(build,D)
.STAR_DECLARE_DEPENDENCIES(link,D)
STAR_DECLARE_DEPENDENCIES(build,D,link)
.In full, the types of dependencies are as follows:
star2html
as well as
messgen
. These dependencies are
generally added for you, by the
STAR_LATEX_DOCUMENTATION
or
STAR_MESSGEN
macros.compifl
tool within the
parsecon
component). See also the
discussion of `option', below. You may not have two
components which have a build dependency on each
other, since that would mean that each would have to
be built before the other, which is impossible.make configure-deps
stage of the bootstrapping build process.You should try hard to avoid declaring dependencies of this type, since they necessarily subvert the normal build order. Note that transitivity implies that any dependencies of a configure dependency are also configure dependencies, so that declaring a configure dependency on sst for example (an obvious but bad plan), results in half the software set being built before configuration. Which is crazy.
You can see the set of configure dependencies by
looking at the configure-deps
target in
Makefile.dependencies
.
.rpm
or .deb
packages.
You should add any use dependencies you are aware
of, even though we cannot really debug them until a
distribution system is in place.The point of all this is that different dependencies are required at different times. The set of dependencies in the master makefile is composed of all the `sourceset' and `build' dependencies, but not `link' or `use' dependencies, and since the core Starlink libraries are closely interdependent, the set of `build' dependencies needs to be kept as small as possible in order to avoid circularities (that is, A depending on B, which depends, possibly indirectly, on A).
It is because of this intricacy that the dependencies scheme is so complicated. In general, it is safe to declare most things to have build dependencies, and only refine these into link or use dependencies when things won't work otherwise.
All these relationships are transitive: if A has a build
dependency on B, and B has one on C, then A has a build
dependency on C. You can augment this by using the final
`option' argument: if, in component A's
configure.ac
, you say
STAR_DECLARE_DEPENDENCIES(build, B, link)
,
then you declare that A has a build-time dependency on B,
but that (presumably because B is a component consisting
entirely or mostly of libraries) you need to link against
B, so component A has a dependency on all of B's
link dependencies, not just its build
dependencies. An application component should generally
declare such a dependency for each of the libraries it
depends on. This is (I believe) the only case where this
`option' attribute is useful, though it is legal for each
of the dependency types.
Because of the transitivity, you need only declare direct dependencies. If package A depends on package B, which depends in turn on package C, then package A need not declare a dependency on C.
The macro may be called more than once. The results of
this macro are expressed in the file
component.xml
in the component directory.