]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add UL_CONFLICTS_BUILD m4 macro
authorKarel Zak <kzak@redhat.com>
Thu, 31 May 2012 08:02:52 +0000 (10:02 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Jun 2012 18:48:22 +0000 (20:48 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
m4/ul.m4

index e7d35feead2562cdaef703250e59134299dd71f6..2109aaa9b6948ab89b85dc738eed860ef9122b61 100644 (file)
--- 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_<name> and $build_<another>
+dnl   are both set to 'yes'
+dnl - sets $build_<name> to 'no' if $build_<another> is 'yes' and
+dnl   $enable_<name> is 'check' or 'no'
+dnl
+dnl The <havedesc> is description used for warning/error
+dnl message (e.g. "function").
+dnl
+dnl The default <name> 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_<name> variable according to $enable_<name> and $have_funcname.