summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-11 12:39:01 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-11 13:24:58 +0100
commit545fe0fe04635e62216f452f659a5a40469d3190 (patch)
tree7d679fb266196884d3cb4807636b974992ef4ac0 /configure.ac
parent2038b2470d83fc13e238dd884ee1b5676dd04385 (diff)
lib; Add x86 cpuid based feature detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
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 <cpuid.h>
+ #include <stddef.h>
+ ],
+ [
+ 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