diff options
author | Booker C. Bense <bbense@gmail.com> | 2013-08-19 11:14:05 -0700 |
---|---|---|
committer | Booker C. Bense <bbense@gmail.com> | 2013-08-19 11:14:05 -0700 |
commit | f12edfd07384be4060d5c724ac38ee212adc9028 (patch) | |
tree | 099c7d0c1faac4670fe5b59d0f5b9e2f499f3f93 /configure.in | |
parent | 64b4d1fb665005c9442361094e02cfd25aa15f43 (diff) | |
download | monitoring-plugins-f12edfd07384be4060d5c724ac38ee212adc9028.tar.gz |
Bug fix for ncpus if hyperthreading turned off in linux
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/configure.in b/configure.in index 43fe4ade..2be2a1c6 100644 --- a/configure.in +++ b/configure.in @@ -1270,12 +1270,20 @@ fi AC_MSG_CHECKING([for number of cpus]) AC_TRY_COMPILE([#include <unistd.h>], - [sysconf(_SC_NPROCESSORS_CONF) > 0;], - AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus]) - AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), + [sysconf(_SC_NPROCESSORS_ONLN) > 0;], + AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of cpus]) + AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]), AC_MSG_RESULT([cannot calculate]) ) +AC_TRY_COMPILE([#include <unistd.h>], + [sysconf(_SC_NPROCESSORS_CONF) > 0;], + AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus]) + AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), + AC_MSG_RESULT([cannot calculate]) + ) + + AC_PATH_PROG(PATH_TO_UPTIME,uptime) AC_ARG_WITH(uptime_command, ACX_HELP_STRING([--with-uptime-command=PATH], |