To prevent replay attacks, HOTP uses a counter, while TOTP keeps track of the time the key was last used. Since these values have the same type and are never used at the same time, merge them into an anonymous union.
Introduce a new macro, CRYB_I_AM, which replaces CRYB_INIT for projects that provide Cryb components or extensions. Currently, the main difference is that they are not required to have the exact same PACKAGE_VERSION as the Cryb version that they use.
Most importantly, differentiate between library and non-library components. The former can be provided and required, and if provided but disabled, can be replaced by pre-installed versions. The latter can only be provided and cannot be the target of a dependency relationship.
Previously, we always invoked AX_PKG_CONFIG_CHECK() for a disabled component (i.e. a component which we provide but which was disabled on the configure command line). This is both excessive (because we only need to run this check for components that will be needed during the build) and insufficient (because we also need to run it for components from other Cryb projects).
The caveat is needed because if you include one of these headers on a system that defines rsize_t without having the correct incantations in your configure.ac, you are going to have a bad time. But there is no good general solution to the problem.
These macros are designed to work in concert with the AX_PKG_CONFIG macros. It is now possible to disable any component, even if another depends on it, provided that it is already installed. For enabled components, we define the same variables as AX_PKG_CONFIG would, so Makefiles don't need to know if a component they rely on is being built as part of this packge or if it was already installed.
This is the default if the AM_MAINTAINER_MODE macro is not invoked, but invoking it also creates the --disable-maintainer-mode option which some automated build tools use to speed up builds from a clean tree.
Instead of using the enclosing source tree, use automake's distdir target to copy a clean set of sources into WRKSRC. This protects us from a polluted tree, prevents us from polluting it in turn, and allows the ports framework to perform necessary substitutions in libtool and the like.