summaryrefslogtreecommitdiffstats
path: root/m4/ul.m4
diff options
context:
space:
mode:
authorManuel Bentele2019-08-21 14:58:42 +0200
committerManuel Bentele2019-08-21 14:58:42 +0200
commit0692b963aa3cb846d8abab5ef5247c4dbb3fec96 (patch)
treef13776d25da3e1adc1445aef22e7566ac98cbe84 /m4/ul.m4
parentlosetup: added file format option to the man page (diff)
parentpartx: document -d vs. --nr and fix test (diff)
downloadkernel-qcow2-util-linux-kernel-qcow2.tar.gz
kernel-qcow2-util-linux-kernel-qcow2.tar.xz
kernel-qcow2-util-linux-kernel-qcow2.zip
lib/losetup: merge remote-tracking branch 'util-linux/master'kernel-qcow2
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
Diffstat (limited to 'm4/ul.m4')
-rw-r--r--m4/ul.m442
1 files changed, 41 insertions, 1 deletions
diff --git a/m4/ul.m4 b/m4/ul.m4
index 9b3e73d22..e32af44a3 100644
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -208,6 +208,46 @@ AC_DEFUN([UL_EXCLUDE_ARCH], [
fi
])
+
+
+dnl UL_REQUIRES_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 <arch> maybe a list, then at least one of the patterns in the list
+dnl have to match.
+dnl
+dnl The default <name> for $build_ and $enable_ could be overwrited by option $3.
+dnl
+AC_DEFUN([UL_REQUIRES_ARCH], [
+ m4_define([suffix], m4_default([$3],$1))
+ if test "x$[build_]suffix" != xno; then
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ [ul_archone_]suffix=no
+ m4_foreach([onearch], [$2], [
+ case "$host" in #(
+ onearch)
+ [ul_archone_]suffix=yes ;;
+ esac
+ ])dnl
+ case $[enable_]suffix:$[ul_archone_]suffix in #(
+ no:*)
+ [build_]suffix=no ;;
+ yes:no)
+ AC_MSG_ERROR([$1 selected for unsupported architecture]);;
+ yes:*)
+ [build_]suffix=yes ;;
+ check:no)
+ AC_MSG_WARN([excluded for $host architecture; not building $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
@@ -248,7 +288,7 @@ AC_DEFUN([UL_REQUIRES_HAVE], [
fi
])
-dnl UL_REQUIRES_HAVE(NAME, PROGRAM_PROLOGUE, PROGRAM_BODY, DESC, [VARSUFFIX=$1])
+dnl UL_REQUIRES_COMPILE(NAME, PROGRAM_PROLOGUE, PROGRAM_BODY, DESC, [VARSUFFIX=$1])
dnl
dnl Modifies $build_<name> variable according to $enable_<name> and
dnl ability compile AC_LANG_PROGRAM(<program_prologue>, <program_body>).