Commits

Anonymous committed 6a8cfe4

don't check for the number of CPUs on configure. The macro is not cross platforms and we don't use it anyway (fixes #16)

Comments (0)

Files changed (3)

 #   by requesting cpuid. The results are available in the defines
 #   CPU_L1_CACHE and CPU_L2_CACHE.
 #
-#   This macro depends on AX_GCC_X86_CPUID, AC_PROG_SED, AX_COUNT_CPUS, and
-#   AX_CPU_VENDOR.
+#   This macro depends on AX_GCC_X86_CPUID, AC_PROG_SED, and AX_CPU_VENDOR.
 #
 # LAST MODIFICATION
 #
 
 AC_DEFUN([AX_CACHE_SIZE],
 [
-  AC_REQUIRE([AC_PROG_SED])
-  AC_REQUIRE([AX_COUNT_CPUS])
-  AC_REQUIRE([AX_GCC_X86_CPUID])
-  AC_REQUIRE([AX_CPU_VENDOR])
+    AC_REQUIRE([AC_PROG_SED])
+    AC_REQUIRE([AX_GCC_X86_CPUID])
+    AC_REQUIRE([AX_CPU_VENDOR])
 
-  AX_COUNT_CPUS
-  AX_CPU_VENDOR
+    AX_CPU_VENDOR
 
     ax_l1_size=
     ax_l2_size=
 
     #Check if the variable is present
     if test -e /sys/devices/system/cpu/cpu0/cache/index0/size; then
-      for ncpu in `seq 0 $(($CPU_COUNT-1))`; do
         for idx in `seq 0 3`; do
-          if test -e /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/size ; then
-            level=`cat /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/level`
-            size=`cat /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/size`
-            eval CPU$ncpu\_L$level\_CACHE="$size"
-          fi
+            if test -e /sys/devices/system/cpu/cpu0/cache/index$idx/size ; then
+                level=`cat /sys/devices/system/cpu/cpu0/cache/index$idx/level`
+                size=`cat /sys/devices/system/cpu/cpu0/cache/index$idx/size`
+                eval CPU0\_L$level\_CACHE="$size"
+            fi
         done
-      done
 
-      # This part can (must !!!) be optimized, because we know all caches per proc but
-      # we only take care about the first proc
-      ax_l1_size=$CPU0_L1_CACHE
-      ax_l2_size=$CPU0_L2_CACHE
+        ax_l1_size=$CPU0_L1_CACHE
+        ax_l2_size=$CPU0_L2_CACHE
 
     else
       if test "x$ax_cv_cpu_vendor" != "xUnknown"; then

m4/ax_count_cpus.m4

-# ===========================================================================
-#             http://autoconf-archive.cryp.to/ax_count_cpus.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_COUNT_CPUS
-#
-# DESCRIPTION
-#
-#   Attempt to count the number of processors present on the machine. If the
-#   detection fails, then a value of 1 is assumed.
-#
-#   The value is placed in the CPU_COUNT variable.
-#
-# LAST MODIFICATION
-#
-#   2008-04-12
-#
-# COPYLEFT
-#
-#   Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
-#   Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved.
-
-AC_DEFUN([AX_COUNT_CPUS], [
-    AC_REQUIRE([AC_PROG_EGREP])
-    AC_MSG_CHECKING(the number of available CPUs)
-    CPU_COUNT="0"
-
-    #On MacOS & *BSD
-    if test -x /usr/sbin/sysctl -a -n "$(/usr/sbin/sysctl -n hw.ncpu 2>/dev/null)"; then
-        CPU_COUNT=`/usr/sbin/sysctl -n hw.ncpu`
-    elif test -x /sbin/sysctl -a -n "$(/sbin/sysctl -n hw.ncpu 2>/dev/null)"; then
-        CPU_COUNT=`/sbin/sysctl -n hw.ncpu`
-    fi
-
-    #On Linux
-    if test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo; then
-        CPU_COUNT=`$EGREP -c '^processor' /proc/cpuinfo`
-    fi
-
-    if test "x$CPU_COUNT" = "x0"; then
-        CPU_COUNT="1"
-        AC_MSG_RESULT( [unable to detect (assuming 1)] )
-    else
-        AC_MSG_RESULT( $CPU_COUNT )
-    fi
-])
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION