• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dnl
2dnl Copyright (c) Cisco Systems Inc., 2009
3dnl
4dnl This program is free software;  you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 2 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
12dnl the GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program;  if not, write to the Free Software
16dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17dnl
18dnl Author: Ngie Cooper <yaneurabeya@gmail.com>
19dnl
20
21dnl
22dnl LTP_CHECK_SYSCALL_NUMA
23dnl ----------------------------
24dnl
25AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
26[dnl
27AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
28	LTP_SYSCALL_NUMA_HEADERS=yes
29	AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
30	if  test "x$have_numa_alloc_onnode" = "xyes"; then
31		AC_DEFINE(HAVE_NUMA_ALLOC_ONNODE,1,[define to 1 if you have 'numa_alloc_onnode' function])
32	fi
33	AC_CHECK_LIB(numa,numa_move_pages,[have_numa_move_pages="yes"])
34	if  test "x$have_numa_move_pages" = "xyes"; then
35		AC_DEFINE(HAVE_NUMA_MOVE_PAGES,1,[define to 1 if you have 'numa_move_pages' function])
36	fi
37]
38	AC_CHECK_LIB(numa,numa_available,[
39NUMA_CPPFLAGS="-DNUMA_VERSION1_COMPATIBILITY"
40NUMA_LIBS="-lnuma"
41	])
42dnl For testcases/kernel/controllers/cpuset, testcases/kernel/syscalls/get_mempolicy,
43dnl testcases/kernel/syscalls/mbind
44AC_CHECK_DECLS([MPOL_BIND, MPOL_DEFAULT, MPOL_F_ADDR, MPOL_F_MEMS_ALLOWED, MPOL_F_NODE, MPOL_INTERLEAVE, MPOL_PREFERRED],[have_mpol_constants="yes"],,[#include <numaif.h>])
45AC_SUBST(NUMA_CPPFLAGS)
46AC_SUBST(NUMA_LIBS)
47if test "x$have_mpol_constants" = "xyes"; then
48	AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests])
49fi
50)])
51