]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add UL_EXCLUDE_ARCH()
authorKarel Zak <kzak@redhat.com>
Wed, 21 May 2014 10:57:13 +0000 (12:57 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 21 May 2014 10:57:13 +0000 (12:57 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
m4/ul.m4

index 79de3c7a3d94e2842ef0f44d1af5e99427cc8b75..8d537de32f121175519e49bd4703f1da0333cc3d 100644 (file)
@@ -829,7 +829,8 @@ UL_REQUIRES_BUILD([fdisk], [libfdisk])
 AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
 
 
-UL_BUILD_INIT([sfdisk], [yes])
+UL_BUILD_INIT([sfdisk], [check])
+UL_EXCLUDE_ARCH([sfdisk], [spark*])
 AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
 
 
index d18f45914c1b7bd5648dceedff6fca9b03a29375..9d4dc5619c758fb5b73a29cf1681df3d615b65fa 100644 (file)
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -154,6 +154,35 @@ AC_DEFUN([UL_REQUIRES_LINUX], [
   fi
 ])
 
+
+dnl UL_EXCLUDE_ARCH(NAME, ARCH, VARSUFFIX = $1])
+dnl
+dnl Modifies $build_<name>  variable according to $enable_<name> and $host. The
+dnl $enable_<name> could be "yes", "no" and "check". If build_<name> is "no" then
+dnl all checks are skiped.
+dnl
+dnl The default <name> for $build_ and $enable_ could be overwrited by option $3.
+dnl
+AC_DEFUN([UL_EXCLUDE_ARCH], [
+  m4_define([suffix], m4_default([$3],$1))
+  if test "x$[build_]suffix" != xno; then
+    AC_REQUIRE([AC_CANONICAL_HOST])
+    case $[enable_]suffix:"$host" in #(
+    no:*)
+      [build_]suffix=no ;;
+    yes:$2)
+      AC_MSG_ERROR([$1 selected for unsupported architecture]);;
+    yes:*)
+      [build_]suffix=yes ;;
+    check:$2)
+      AC_MSG_WARN([exclude for $host architecture; do not build $1])
+      [build_]suffix=no ;;
+    check:*)
+      [build_]suffix=yes ;;
+    esac
+  fi
+])
+
 dnl UL_REQUIRES_HAVE(NAME, HAVENAME, HAVEDESC [VARSUFFIX=$1])
 dnl
 dnl Modifies $build_<name> variable according to $enable_<name> and