summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-08-24 12:44:26 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-08-30 06:14:44 -0400
commit78afc2c92f94c7bbb94d774adc577aa039119172 (patch)
treefcc17677115327f5e0c45982dfafff76b03b6730 /configure.ac
parent304067a0cb01af1ce9986009065419e86788050c (diff)
downloadhaskell-78afc2c92f94c7bbb94d774adc577aa039119172.tar.gz
configure.ac: add --enable-numa switch
Before the change ./configure detected numa support automatically withoun a nice way to disable autodetection. The change adds `--enable-numa` / `--disable-numa` switch to override the default. If `--enable-numa` is passed and `libnuma` is not present then configure will fail. Reported-by: Sergey Alirzaev Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/955 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6f57d3b5ec..9fc54fc218 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1265,11 +1265,22 @@ AC_DEFINE_UNQUOTED([USE_LIBDW], [$USE_LIBDW], [Set to 1 to use libdw])
dnl ** Have libnuma?
dnl --------------------------------------------------------------
HaveLibNuma=0
-AC_CHECK_HEADERS([numa.h numaif.h])
+AC_ARG_ENABLE(numa,
+ [AC_HELP_STRING([--enable-numa],
+ [Enable NUMA memory policy and thread affinity support in the
+ runtime system via numactl's libnuma [default=auto]])])
-if test "$ac_cv_header_numa_h$ac_cv_header_numaif_h" = "yesyes" ; then
+if test "$enable_numa" != "no" ; then
+ AC_CHECK_HEADERS([numa.h numaif.h])
+
+ if test "$ac_cv_header_numa_h$ac_cv_header_numaif_h" = "yesyes" ; then
AC_CHECK_LIB(numa, numa_available,HaveLibNuma=1)
+ fi
+ if test "$enable_numa:$HaveLibNuma" = "yes:0" ; then
+ AC_MSG_ERROR([Cannot find system libnuma (required by --enable-numa)])]
+ fi
fi
+
AC_DEFINE_UNQUOTED([HAVE_LIBNUMA], [$HaveLibNuma], [Define to 1 if you have libnuma])
if test $HaveLibNuma = "1" ; then
AC_SUBST([CabalHaveLibNuma],[True])