From a439adc68f93ee8c810609c46fd335ff9244573f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 15 Nov 2018 18:10:47 +0100 Subject: [PATCH] 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. --- configure.ac | 2 +- m4/cryb_to.m4 | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 13b543d..6c4dbf0 100644 --- a/configure.ac +++ b/configure.ac @@ -188,7 +188,7 @@ unset XFLAGS # Components # -CRYB_INIT +CRYB_I_AM CRYB_LIB_PROVIDE([cipher], [core]) CRYB_LIB_PROVIDE([core], []) diff --git a/m4/cryb_to.m4 b/m4/cryb_to.m4 index 6edc9a0..a9dda6b 100644 --- a/m4/cryb_to.m4 +++ b/m4/cryb_to.m4 @@ -1,6 +1,7 @@ dnl -*- autoconf -*- dnl dnl Copyright (c) 2018 The University of Oslo +dnl Copyright (c) 2018 Dag-Erling Smørgrav dnl All rights reserved. dnl 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 -m4_define([CRYB_MACROS_VERSION], [0.20180513]) +m4_define([CRYB_MACROS_VERSION], [0.20181115]) dnl -dnl CRYB_INIT -dnl --------- +dnl CRYB_INIT([version]) +dnl -------------------- dnl -dnl Initialize. +dnl Initialize (for consumers). dnl 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], AS_HELP_STRING([--disable-all], [disable all components]), @@ -118,7 +132,7 @@ AC_DEFUN([CRYB_RESOLVE], [ if test [x"$cryb_]comp[_needed" = x"yes"] && \ test [x"$enable_cryb_]comp[" != x"yes"] && \ 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 ]) AC_MSG_RESULT([ok])