From 5f226a23a116e694467c1f374aacb9e3dbf48452 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 25 Apr 2013 18:59:55 -0700 Subject: [PATCH] Check for cpuid instruction --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index 47f793ef..255d3b2f 100644 --- a/configure.ac +++ b/configure.ac @@ -180,6 +180,20 @@ uint128_t x; AM_CONDITIONAL([HAVE_TI_MODE], [test $HAVE_TI_MODE_V = 1]) AC_SUBST(HAVE_TI_MODE_V) +AC_MSG_CHECKING(for cpuid instruction) +HAVE_CPUID_V=0 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +]], [[ +__asm__("cpuid" : "=a"(*eax), "=b" (*ebx), "=c"(*ecx), "=d"(*edx) + : "0"(level)); +]])], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_CPUID], [1], [cpuid instruction is available]) + HAVE_CPUID_V=1], +[AC_MSG_RESULT(no)]) +AM_CONDITIONAL([HAVE_CPUID], [test $HAVE_CPUID_V = 1]) +AC_SUBST(HAVE_CPUID_V) + dnl Checks for functions and headers AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)])