Home | History | Annotate | Download | only in m4
      1 dnl
      2 dnl Copyright (c) Cisco Systems Inc., 2009
      3 dnl
      4 dnl This program is free software;  you can redistribute it and/or modify
      5 dnl it under the terms of the GNU General Public License as published by
      6 dnl the Free Software Foundation; either version 2 of the License, or
      7 dnl (at your option) any later version.
      8 dnl
      9 dnl This program is distributed in the hope that it will be useful,
     10 dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
     11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     12 dnl the GNU General Public License for more details.
     13 dnl
     14 dnl You should have received a copy of the GNU General Public License
     15 dnl along with this program;  if not, write to the Free Software
     16 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     17 dnl
     18 dnl Author: Garrett Cooper <yanegomi (a] gmail.com>
     19 dnl
     20 
     21 dnl
     22 dnl LTP_CHECK_SYSCALL_NUMA
     23 dnl ----------------------------
     24 dnl
     25 AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
     26 [dnl
     27 AC_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,[
     39 NUMA_CPPFLAGS="-DNUMA_VERSION1_COMPATIBILITY"
     40 NUMA_LIBS="-lnuma"
     41 	])
     42 dnl For testcases/kernel/controllers/cpuset, testcases/kernel/syscalls/get_mempolicy,
     43 dnl testcases/kernel/syscalls/mbind
     44 AC_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>])
     45 AC_SUBST(NUMA_CPPFLAGS)
     46 AC_SUBST(NUMA_LIBS)
     47 if 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])
     49 fi
     50 )])
     51