From a9e48470be8a52175149bf79627d79f51858dec9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 31 May 2012 10:02:52 +0200 Subject: build-sys: add UL_CONFLICTS_BUILD m4 macro Signed-off-by: Karel Zak --- m4/ul.m4 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'm4') diff --git a/m4/ul.m4 b/m4/ul.m4 index e7d35feea..2109aaa9b 100644 --- a/m4/ul.m4 +++ b/m4/ul.m4 @@ -182,6 +182,36 @@ AC_DEFUN([UL_REQUIRES_HAVE], [ fi ]) + +dnl +dnl UL_CONFLICTS_BUILD(NAME, ANOTHER, ANOTHERDESC [VARSUFFIX=$1]) +dnl +dnl - ends with error if $enable_ and $build_ +dnl are both set to 'yes' +dnl - sets $build_ to 'no' if $build_ is 'yes' and +dnl $enable_ is 'check' or 'no' +dnl +dnl The is description used for warning/error +dnl message (e.g. "function"). +dnl +dnl The default for $build_ and $enable_ could be overwrited by option $3. +dnl +AC_DEFUN([UL_CONFLICTS_BUILD], [ + m4_define([suffix], m4_default([$4],$1)) + + if test "x$[build_]suffix" != xno; then + case $[enable_]suffix:$[build_]$2 in #( + no:*) + [build_]suffix=no ;; + check:yes) + [build_]suffix=no ;; + yes:yes) + AC_MSG_ERROR([$1 selected, but it conflicts with $3]);; + esac + fi +]) + + dnl UL_REQUIRES_BUILD(NAME, BUILDNAME, [VARSUFFIX=$1]) dnl dnl Modifies $build_ variable according to $enable_ and $have_funcname. -- cgit v1.2.3-55-g7522