x86 NCG: fix regUsageOfInstr for VMOVU & friends
[ghc.git] / m4 / fp_find_libnuma.m4
blob83930954f475fa877a63460379a8f37b90018834
1 # FP_FIND_LIBNUMA
2 # --------------------------------------------------------------
3 # Should we used libnuma? (yes, no, or auto.)
5 # Sets variables:
6 #   - UseLibNuma: [YES|NO]
7 #   - LibNumaLibDir: optional path
8 #   - LibNumaIncludeDir: optional path
9 AC_DEFUN([FP_FIND_LIBNUMA],
11   AC_ARG_WITH([libnuma-libraries],
12     [AS_HELP_STRING([--with-libnuma-libraries=ARG],
13       [Find libraries for libnuma in ARG [default=system default]])
14     ],
15     [
16       LibNumaLibDir="$withval"
17       LIBNUMA_LDFLAGS="-L$withval"
18     ])
20   AC_ARG_WITH([libnuma-includes],
21     [AS_HELP_STRING([--with-libnuma-includes=ARG],
22       [Find includes for libnuma in ARG [default=system default]])
23     ],
24     [
25       LibNumaIncludeDir="$withval"
26       LIBNUMA_CFLAGS="-I$withval"
27     ])
29   AC_ARG_ENABLE(numa,
30     [AS_HELP_STRING([--enable-numa],
31       [Enable NUMA memory policy and thread affinity support in the
32        runtime system via numactl's libnuma [default=auto]])],
33     [],
34     [enable_numa=auto])
36   UseLibNuma=NO
37   if test "$enable_numa" != "no" ; then
38     CFLAGS2="$CFLAGS"
39     CFLAGS="$LIBNUMA_CFLAGS $CFLAGS"
40     LDFLAGS2="$LDFLAGS"
41     LDFLAGS="$LIBNUMA_LDFLAGS $LDFLAGS"
43     AC_CHECK_HEADERS([numa.h numaif.h])
45     if test "$ac_cv_header_numa_h:$ac_cv_header_numaif_h" = "yes:yes" ; then
46       AC_CHECK_LIB([numa], [numa_available], [UseLibNuma=YES])
47     fi
48     if test "$enable_numa:$UseLibNuma" = "yes:NO" ; then
49       AC_MSG_ERROR([Cannot find system libnuma (required by --enable-numa)])
50     fi
52     CFLAGS="$CFLAGS2"
53     LDFLAGS="$LDFLAGS2"
54   fi