mirror of
https://github.com/AuxXxilium/kmod.git
synced 2025-02-20 08:26:55 +07:00
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.
This commit is contained in:
parent
ba52c77e04
commit
e6307200af
@ -47,6 +47,9 @@ AC_CHECK_FUNCS_ONCE(__xstat)
|
||||
AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
|
||||
AC_CHECK_FUNCS_ONCE([finit_module])
|
||||
|
||||
CC_CHECK_FUNC_BUILTIN([__builtin_clz])
|
||||
CC_CHECK_FUNC_BUILTIN([__builtin_types_compatible_p])
|
||||
|
||||
# dietlibc doesn't have st.st_mtim struct member
|
||||
AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
|
||||
|
||||
|
@ -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])
|
||||
])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user