From 545fe0fe04635e62216f452f659a5a40469d3190 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 11 Jul 2016 12:39:01 +0100 Subject: lib; Add x86 cpuid based feature detection Signed-off-by: Chris Wilson --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c852d55d..f05bcb0e 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,25 @@ AC_CHECK_FUNCS(timer_create, [], [ ]) AC_SUBST(TIMER_LIBS) +dnl Check for CPUID +cpuid="yes" +AC_TRY_LINK([ + #include + #include + ], + [ + int eax, ebx, ecx, edx; + if (__get_cpuid_max(0, NULL) < 4) + return 0; + __cpuid_count(4, 0, eax, ebx, ecx, edx); + ], + [cpuid="yes"], + [cpuid="no"] +) +if test "x$cpuid" = "xyes"; then + AC_DEFINE(HAVE_CPUID_H, 1, [Found a useable cpuid.h]) +fi + # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL -- cgit v1.2.3