diff --git a/configure.ac b/configure.ac index 95eb972..00f4a7e 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,7 @@ case $host_cpu in i?86 | x86_64 | amd64) dnl GCC_FLAG_ADD([-maes -mpclmul],[X86]) dnl if test "x$X86" = "xyes";then + AC_CHECK_HEADERS(cpuid.h) if test "$host_cpu" = "x86_64" -o "$host_cpu" = "amd64";then hw_accel="x86-64" else diff --git a/lib/accelerated/x86.h b/lib/accelerated/x86.h index c344283..8886516 100644 --- a/lib/accelerated/x86.h +++ b/lib/accelerated/x86.h @@ -1,3 +1,12 @@ +#include + +#ifdef HAVE_CPUID_H +# include +# define cpuid __cpuid + +#else #define cpuid(func,ax,bx,cx,dx)\ __asm__ __volatile__ ("cpuid":\ "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func)); + +#endif