From 240f3056aa0e095a6b03d5763c2775e97b4ee7d3 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 14 Jul 2013 14:28:33 +0000 Subject: * configure.in: Check __builtin_popcountl, __builtin_bswap32 and __builtin_bswap64. * internal.h (swap32): Use the configure result for the condition to use __builtin_bswap32. (swap64): Use the configure result for the condition to use __builtin_bswap64. * bignum.c (ones): Use the configure result for the condition to use __builtin_popcountl. (bary_unpack_internal): Use appropriate types for swap argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index dce99e36b4..adc465a427 100644 --- a/configure.in +++ b/configure.in @@ -1838,6 +1838,19 @@ AC_CHECK_FUNCS(utimes) AC_CHECK_FUNCS(wait4) AC_CHECK_FUNCS(waitpid) +AC_DEFUN([RUBY_CHECK_BUILTIN_FUNC], [dnl +AC_CACHE_CHECK([for $1], AS_TR_SH(rb_cv_builtin_$1), + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [$2;])], + [AS_TR_SH(rb_cv_builtin_$1)=yes], + [AS_TR_SH(rb_cv_builtin_$1)=no])]) +if test "${AS_TR_SH(rb_cv_builtin_$1)}" != no; then + AC_DEFINE(AS_TR_CPP(HAVE_BUILTIN_$1)) +fi]) +RUBY_CHECK_BUILTIN_FUNC(__builtin_popcountl, [__builtin_popcountl(0)]) +RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap32, [__builtin_bswap32(0)]) +RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)]) + # Some platform neet -lrt for clock_gettime, but the other don't. if test x"$ac_cv_func_clock_gettime" != xyes; then # glibc 2.17 moves clock_* functions from librt to the main C library. -- cgit v1.2.3