summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2015-02-10 00:45:11 -0200
committerLucas De Marchi <lucas.demarchi@intel.com>2015-02-10 00:45:42 -0200
commite6307200af74d1556466522216e8ae77b7c8b843 (patch)
tree752e3ed562011f36ea380ac1ed1766974c9c1bb5 /m4
parentba52c77e04b0f2d5a9ebee147f4445ac8b1f2b2a (diff)
downloadkmod-e6307200af74d1556466522216e8ae77b7c8b843.tar.gz
kmod-e6307200af74d1556466522216e8ae77b7c8b843.tar.bz2
kmod-e6307200af74d1556466522216e8ae77b7c8b843.zip
build: check for required builtin functions
These builtins are implemented by both gcc and clang since a long time and we don't provide fallback for them. Let the configure phase check for them.
Diffstat (limited to 'm4')
-rw-r--r--m4/attributes.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index af17a6b..db39bf9 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -260,6 +260,8 @@ AC_DEFUN([CC_CHECK_FUNC_BUILTIN], [
[cc_cv_have_$1],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
m4_case([$1],
+ [__builtin_clz], [$1(0)],
+ [__builtin_types_compatible_p], [$1(int, int)],
[__builtin_expect], [$1(0, 0)]
)])],
[cc_cv_have_$1=yes],
@@ -267,7 +269,9 @@ AC_DEFUN([CC_CHECK_FUNC_BUILTIN], [
AS_IF([test "x$cc_cv_have_$1" = "xyes"],
[AC_DEFINE([HAVE_]m4_defn([UPNAME]), 1, [Define this if the compiler supports $1() function])
- $2], [$3])
+ $2],
+ [AS_IF([test "x$3" = "x"], [AC_MSG_ERROR([*** builtin function not found: $1()])], [$3])]
+ )
m4_popdef([UPNAME])
])