summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-02-17 17:50:56 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-26 15:08:47 -0500
commitdef486c90ef6f37d81d0d9c6df754431ff94c6a4 (patch)
tree698fc18d7c9f21075057285495d3436082ebf6ce /configure.ac
parent621468f680a111c20366a9445a3b225cbc34ffbf (diff)
downloadhaskell-def486c90ef6f37d81d0d9c6df754431ff94c6a4.tar.gz
hadrian: Allow libnuma library path to be specified
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 32 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 9559d9672e..02a04dd15f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1285,6 +1285,28 @@ AC_DEFINE_UNQUOTED([USE_LIBDW], [$USE_LIBDW], [Set to 1 to use libdw])
dnl ** Have libnuma?
dnl --------------------------------------------------------------
+AC_ARG_WITH([libnuma-libraries],
+ [AC_HELP_STRING([--with-libnuma-libraries=ARG],
+ [Find libraries for libnuma in ARG [default=system default]])
+ ],
+ [
+ LibNumaLibDir="$withval"
+ LIBNUMA_LDFLAGS="-L$withval"
+ ])
+
+AC_SUBST(LibNumaLibDir)
+
+AC_ARG_WITH([libnuma-includes],
+ [AC_HELP_STRING([--with-libnuma-includes=ARG],
+ [Find includes for libnuma in ARG [default=system default]])
+ ],
+ [
+ LibNumaIncludeDir="$withval"
+ LIBNUMA_CFLAGS="-I$withval"
+ ])
+
+AC_SUBST(LibNumaIncludeDir)
+
HaveLibNuma=0
AC_ARG_ENABLE(numa,
[AC_HELP_STRING([--enable-numa],
@@ -1292,6 +1314,11 @@ AC_ARG_ENABLE(numa,
runtime system via numactl's libnuma [default=auto]])])
if test "$enable_numa" != "no" ; then
+ CFLAGS2="$CFLAGS"
+ CFLAGS="$LIBNUMA_CFLAGS $CFLAGS"
+ LDFLAGS2="$LDFLAGS"
+ LDFLAGS="$LIBNUMA_LDFLAGS $LDFLAGS"
+
AC_CHECK_HEADERS([numa.h numaif.h])
if test "$ac_cv_header_numa_h$ac_cv_header_numaif_h" = "yesyes" ; then
@@ -1300,16 +1327,20 @@ if test "$enable_numa" != "no" ; then
if test "$enable_numa:$HaveLibNuma" = "yes:0" ; then
AC_MSG_ERROR([Cannot find system libnuma (required by --enable-numa)])]
fi
+
+ CFLAGS="$CFLAGS2"
+ LDFLAGS="$LDFLAGS2"
fi
AC_DEFINE_UNQUOTED([HAVE_LIBNUMA], [$HaveLibNuma], [Define to 1 if you have libnuma])
if test $HaveLibNuma = "1" ; then
+ AC_SUBST([UseLibNuma],[YES])
AC_SUBST([CabalHaveLibNuma],[True])
else
+ AC_SUBST([UseLibNuma],[NO])
AC_SUBST([CabalHaveLibNuma],[False])
fi
-
dnl ** Documentation
dnl --------------------------------------------------------------
if test -n "$SPHINXBUILD"; then