summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2015-02-10 10:32:10 -0200
committerLucas De Marchi <lucas.demarchi@intel.com>2015-02-10 10:32:10 -0200
commit14c3244f04002380d94903b661b93185c158077b (patch)
treea3f54403d3361bfac2bf5b31e43de1be353e5885
parent67466f266d4209744a2f6f3e8e92672110be1df3 (diff)
downloadkmod-14c3244f04002380d94903b661b93185c158077b.tar.gz
build: define to 0 if builtin is not available
In order to let us use "#if HAVE__BUILTIN_*" without checking if it's actually define, make sure we define it to 0 in config.h when the function is not available.
-rw-r--r--m4/attributes.m48
1 files changed, 5 insertions, 3 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index db39bf9..7922746 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -256,7 +256,7 @@ AC_DEFUN([CC_FLAG_VISIBILITY], [
AC_DEFUN([CC_CHECK_FUNC_BUILTIN], [
m4_pushdef([UPNAME], m4_translit([$1], [-a-z], [_A-Z]))
- AC_CACHE_CHECK([if compiler has $1 function],
+ AC_CACHE_CHECK([if compiler has $1 builtin function],
[cc_cv_have_$1],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
m4_case([$1],
@@ -268,9 +268,11 @@ AC_DEFUN([CC_CHECK_FUNC_BUILTIN], [
[cc_cv_have_$1=no])])
AS_IF([test "x$cc_cv_have_$1" = "xyes"],
- [AC_DEFINE([HAVE_]m4_defn([UPNAME]), 1, [Define this if the compiler supports $1() function])
+ [AC_DEFINE([HAVE_]m4_defn([UPNAME]), 1, [Define to 1 if compiler has $1() builtin function])
$2],
- [AS_IF([test "x$3" = "x"], [AC_MSG_ERROR([*** builtin function not found: $1()])], [$3])]
+ [AS_IF([test "x$3" = "x"], [AC_MSG_ERROR([*** builtin function not found: $1()])],
+ [AC_DEFINE([HAVE_]m4_defn([UPNAME]), 0)
+ $3])]
)
m4_popdef([UPNAME])
])