OSX fix
authorBrian Aker <brian@tangent.org>
Thu, 8 Mar 2012 08:31:35 +0000 (00:31 -0800)
committerBrian Aker <brian@tangent.org>
Thu, 8 Mar 2012 08:31:35 +0000 (00:31 -0800)
configure.ac
libtest/cpu.cc

index caec223bca9a56c963790b3144dde7c8ba99a8f1..1fe4f7749b29d97cf7e9431a54390fd91c8111be 100644 (file)
@@ -132,6 +132,8 @@ AC_CHECK_HEADERS([cxxabi.h],
                  AC_DEFINE([HAVE_CXXABI_H], [1], [Have cxxabi.h]),
                  AC_DEFINE([HAVE_CXXABI_H], [0], [Have cxxabi.h]))
 
+AC_CHECK_HEADERS([sys/sysctl.h])
+
 AX_COMPILER_VENDOR
 
 AC_FUNC_ALLOCA
index 203796bc77e12ff18bbde47f41ef87c6821f49a1..774e4f39f3fbac4167ed5f9bc1c69198ae8cf930 100644 (file)
@@ -30,7 +30,7 @@ size_t number_of_cpus()
   size_t number_of_cpu= 1;
 #ifdef TARGET_OS_LINUX
   number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN);
-#elif TARGET_OS_OSX || TARGET_OS_FREEBSD
+#elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU)
   int mib[4];
   size_t len= sizeof(number_of_cpu);