[PATCH] build-sys: in top program, enable NUMA/Node extensions

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • Date: Mon, 8 Apr 2013 00:00:00 -0500

This patch provides the build system support for those
top extensions dealing with the NUMA summary displays.

For providing the initial impetus for this enhancement
I wish to thank Lance Shelton <LShelton@xxxxxxxxxxxx>.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@xxxxxxxxxxx>
---
 configure.ac    |   24 ++++++++++++++++++++++++
 top/Makefile.am |    1 +
 2 files changed, 25 insertions(+)

diff --git a/configure.ac b/configure.ac
index 6e0883b..09b6b60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,6 +221,30 @@ if test "x$enable_sigwinch" = xyes; then
   AC_DEFINE(SIGNALS_LESS, 1, [reduce impact of x-windows resize operations on 
top])
 fi
 
+NUMA_LIB=
+AC_SEARCH_LIBS([numa_node_of_cpu], [numa],
+  if test x"$ac_cv_search_numa_node_of_cpu" != x"no"; then
+    NUMA_LIB="$ac_cv_search_numa_node_of_cpu";
+  fi)
+AC_SUBST([NUMA_LIB])
+AC_CHECK_HEADERS([numa.h])
+AC_ARG_ENABLE([numa],
+  AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]),
+  [disable_numa=yes], [disable_numa=no]
+)
+if test "x$disable_numa" != x"yes"; then
+  if test x"$ac_cv_header_numa_h" = x"yes"; then
+    if test x"$ac_cv_search_numa_node_of_cpu" != x"no"; then
+      AC_DEFINE([NUMA_ENABLED], [1], [enable NUMA/Node support in top])
+    else
+      AC_MSG_ERROR([top needs library libnuma, consider using --disable-numa ])
+    fi
+  else
+    AC_MSG_ERROR([top needs header numa.h, consider using --disable-numa])
+  fi
+fi
+## [AC_MSG_ERROR([Could not find a C99 compatible compiler])])
+
 AC_ARG_ENABLE([w-from],
   AS_HELP_STRING([--enable-w-from], [enable w from field by default]),
   [], enable_w_from=no
diff --git a/top/Makefile.am b/top/Makefile.am
index 33d8949..c19eba0 100644
--- a/top/Makefile.am
+++ b/top/Makefile.am
@@ -4,6 +4,7 @@ AM_CPPFLAGS = \
        -DLOCALEDIR=\"$(localedir)\"
 
 AM_LDFLAGS = ../proc/libprocps.la
+AM_LDFLAGS += $(NUMA_LIB)
 
 if WITH_NCURSES
 usrbin_exec_PROGRAMS = \
-- 
1.7.10.4


--=-VNoPomihWS1EteExHze5--


Other related posts:

  • » [PATCH] build-sys: in top program, enable NUMA/Node extensions - Jim Warner