diff options
author | Jim Warner <james.warner@comcast.net> | 2013-04-25 00:00:00 -0500 |
---|---|---|
committer | Craig Small <csmall@enc.com.au> | 2013-05-05 09:12:07 +1000 |
commit | 5686877cd4c83a2daf1be6f2f7f93cd2c1451e75 (patch) | |
tree | 16091aa0d31ca94e64765a50ebcfa754a7af4ed1 /configure.ac | |
parent | a076c37d07674203522a79d73cfb5f4fd894dd3a (diff) | |
download | procps-ng-5686877cd4c83a2daf1be6f2f7f93cd2c1451e75.tar.gz |
build-sys: eliminate dependencies for the NUMA support
Oh that poor ol' build system. With this patch it will
have gone through three separate incarnations in terms
of NUMA/Node support. Those 3 iterations consisted of:
1. A 'porridge too hot' where the top numa support was
enabled if it was built in the presence of libnuma and
the numa.h header. But if the numa library wasn't part
of core packages, that would have broken poor old top.
2. A 'porridge too cold' where numa support was off by
default and must have been explicitly enabled when the
./configure script was run. This could have meant that
distros might not distribute a numa-aware procps, even
though their numa library would have been distributed.
3. And this 'porridge' where the top numa support will
become a 'plug-in' feature activated when the presence
of libnuma.so can be verified at runtime. We'll do our
own loading and symbol resolution (with some help from
dlopen in libdl). Thus maintainers' responsibility for
enabling numa support and then satisfying that library
dependency is now an entirely optional --disable-numa.
As Goldilocks might say about our current configure.ac
"Ummm, I think this porridge tastes just about right".
Reference(s):
. 1) too-hot
commit 87ac6383bb575d964ba9ef6a100b61cdcdc7f15d
. 2) too-cold
commit 53fd7dd1ed120f901cbb31e69453720b038a7ac6
. original idea from: Dr. Fink <werner@suse.de>
http://www.freelists.org/post/procps/top-NUMA-node-CPU-utilization-support,18
Signed-off-by: Jim Warner <james.warner@comcast.net>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 17e35d1..6bf7b2c 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,7 @@ fi # Checks for header files. AC_HEADER_MAJOR AC_CHECK_HEADERS([\ + dlfcn.h \ fcntl.h \ langinfo.h \ libintl.h \ @@ -221,25 +222,14 @@ 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([--enable-numa], [enable NUMA/Node support in top]), - [enable_numa=yes], [] -) -if test "x$enable_numa" = x"yes"; then - if test x"$ac_cv_header_numa_h" = x"no"; then - AC_MSG_ERROR([top numa support requires header 'numa.h']) - fi - if test x"$ac_cv_search_numa_node_of_cpu" = x"no"; then - AC_MSG_ERROR([top numa support requires library 'libnuma']) - fi - AC_DEFINE([NUMA_ENABLED], [1], [enable NUMA/Node support in top]) + AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]), + [disable_numa=yes], []) +if test "x$disable_numa" = x"yes"; then + AC_DEFINE([NUMA_DISABLE], [1], [disable NUMA/Node support in top]) +else + AC_SEARCH_LIBS([dlopen], [dl], [], + [AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])]) fi AC_ARG_ENABLE([w-from], |