Differentiate between provider and consumer.

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.
This commit is contained in:
Dag-Erling Smørgrav 2018-11-15 18:10:47 +01:00
parent 47547534d7
commit a439adc68f
2 changed files with 20 additions and 6 deletions

View file

@ -188,7 +188,7 @@ unset XFLAGS
# Components # Components
# #
CRYB_INIT CRYB_I_AM
CRYB_LIB_PROVIDE([cipher], [core]) CRYB_LIB_PROVIDE([cipher], [core])
CRYB_LIB_PROVIDE([core], []) CRYB_LIB_PROVIDE([core], [])

View file

@ -1,6 +1,7 @@
dnl -*- autoconf -*- dnl -*- autoconf -*-
dnl dnl
dnl Copyright (c) 2018 The University of Oslo dnl Copyright (c) 2018 The University of Oslo
dnl Copyright (c) 2018 Dag-Erling Smørgrav
dnl All rights reserved. dnl All rights reserved.
dnl dnl
dnl Redistribution and use in source and binary forms, with or without dnl Redistribution and use in source and binary forms, with or without
@ -28,15 +29,28 @@ dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl SUCH DAMAGE. dnl SUCH DAMAGE.
dnl dnl
m4_define([CRYB_MACROS_VERSION], [0.20180513]) m4_define([CRYB_MACROS_VERSION], [0.20181115])
dnl dnl
dnl CRYB_INIT dnl CRYB_INIT([version])
dnl --------- dnl --------------------
dnl dnl
dnl Initialize. dnl Initialize (for consumers).
dnl dnl
AC_DEFUN([CRYB_INIT], [ AC_DEFUN([CRYB_INIT], [
CRYB_VERSION=m4_default([$1], [CRYB_MACROS_VERSION])
AC_SUBST([CRYB_VERSION], [$CRYB_VERSION])
])
dnl
dnl
dnl CRYB_I_AM([version])
dnl --------------------
dnl
dnl Initialize (for providers).
dnl
AC_DEFUN([CRYB_I_AM], [
CRYB_INIT([m4_default([$1], [$PACKAGE_VERSION])])
AC_ARG_ENABLE([all], AC_ARG_ENABLE([all],
AS_HELP_STRING([--disable-all], AS_HELP_STRING([--disable-all],
[disable all components]), [disable all components]),
@ -118,7 +132,7 @@ AC_DEFUN([CRYB_RESOLVE], [
if test [x"$cryb_]comp[_needed" = x"yes"] && \ if test [x"$cryb_]comp[_needed" = x"yes"] && \
test [x"$enable_cryb_]comp[" != x"yes"] && \ test [x"$enable_cryb_]comp[" != x"yes"] && \
test [x"$ax_pc_cv_have_cryb_]comp[" = x""] ; then test [x"$ax_pc_cv_have_cryb_]comp[" = x""] ; then
AX_PKG_CONFIG_REQUIRE([cryb-]comp, [$PACKAGE_VERSION]) AX_PKG_CONFIG_REQUIRE([cryb-]comp, [$CRYB_VERSION])
fi fi
]) ])
AC_MSG_RESULT([ok]) AC_MSG_RESULT([ok])