From 1afef1899dde3b0ead9c556bce360afdba42c097 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 26 Sep 2011 03:24:22 +0000 Subject: Add flag to allow using the system install of hwloc. --- configure.ac | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b63ef6b6..b049215b 100644 --- a/configure.ac +++ b/configure.ac @@ -111,15 +111,28 @@ AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find /proc/meminfo. Make sur fi ##### hwloc +AC_ARG_ENABLE(system-hwloc, [AC_HELP_STRING([--enable-system-hwloc], [use the copy of hwloc from your system and not the one bundled with the htop sources. (hwloc required)])], ,enable_system_hwloc="no") enable_xml=no AC_ARG_ENABLE(hwloc, [AC_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, enable_hwloc="yes") if test "x$enable_hwloc" = xyes then - HWLOC_SETUP_CORE([hwloc-1.2.1], [hwloc_happy=yes], [hwloc_happy=no]) + if test "x$enable_system_hwloc" = xyes + then + AC_CHECK_LIB([hwloc], [hwloc_linux_get_tid_cpubind], [], [missing_libraries="$missing_libraries libhwloc"]) + AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"]) + + else + HWLOC_SETUP_CORE([hwloc-1.2.1], [hwloc_bundled=yes], [hwloc_bundled=no]) + fi fi HWLOC_DO_AM_CONDITIONALS -AM_CONDITIONAL([HAVE_HWLOC], [test "x$hwloc_happy" = "xyes"]) -if test "x$hwloc_happy" = "xyes"; then +AM_CONDITIONAL([HAVE_HWLOC], [test "x$hwloc_bundled" = "xyes" -o "x$hwloc_system" = "xyes"]) +AM_CONDITIONAL([HAVE_BUNDLED_HWLOC], [test "x$hwloc_bundled" = "xyes"]) +if test "x$hwloc_system" = "xyes"; then + AC_DEFINE([HAVE_SYSTEM_HWLOC], 1, [Have system hwloc]) + AC_DEFINE([HAVE_HWLOC], 1, [Have hwloc]) +elif test "x$hwloc_bundled" = "xyes"; then + AC_DEFINE([HAVE_BUNDLED_HWLOC], 1, [Use bundled hwloc]) AC_DEFINE([HAVE_HWLOC], 1, [Have hwloc]) fi ##### -- cgit v1.2.3