aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-29 11:10:42 +0100
committerGitHub <noreply@github.com>2021-11-29 11:10:42 +0100
commit99804465afe403ee7e3436b14fa643a9832ca486 (patch)
tree2e1c345a432a3e015a12ec0f7deedb2d0624f290 /configure.ac
parent3d36f48acb90c846ea5f82655161fb07eb6ba2f6 (diff)
parenta9bd06d0ea2c7af9fa33763bdca174db76400ee0 (diff)
Merge pull request #5679 from t184256/optional-libcpuid
Document libcpuid dependency and make it optional
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 65478ecc5..4108eb0a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,10 +195,17 @@ PKG_CHECK_MODULES([SODIUM], [libsodium], [CXXFLAGS="$SODIUM_CFLAGS $CXXFLAGS"])
PKG_CHECK_MODULES([LIBBROTLI], [libbrotlienc libbrotlidec], [CXXFLAGS="$LIBBROTLI_CFLAGS $CXXFLAGS"])
# Look for libcpuid.
+have_libcpuid=
if test "$machine_name" = "x86_64"; then
- PKG_CHECK_MODULES([LIBCPUID], [libcpuid], [CXXFLAGS="$LIBCPUID_CFLAGS $CXXFLAGS"])
- have_libcpuid=1
- AC_DEFINE([HAVE_LIBCPUID], [1], [Use libcpuid])
+ AC_ARG_ENABLE([cpuid],
+ AS_HELP_STRING([--disable-cpuid], [Do not determine microarchitecture levels with libcpuid (relevant to x86_64 only)]))
+ if test "x$enable_cpuid" != "xno"; then
+ PKG_CHECK_MODULES([LIBCPUID], [libcpuid],
+ [CXXFLAGS="$LIBCPUID_CFLAGS $CXXFLAGS"
+ have_libcpuid=1
+ AC_DEFINE([HAVE_LIBCPUID], [1], [Use libcpuid])]
+ )
+ fi
fi
AC_SUBST(HAVE_LIBCPUID, [$have_libcpuid])