* Dr. David Kirkby wrote on Wed, Oct 14, 2009 at 06:36:36AM CEST: > http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_count_cpus.m4 This macro does not look well-designed. It does the wrong thing when cross-compiling, or even only compiling for a different system (which happens to be use the same architecture). A better approach would be to provide the user with a switch, or prefer a user override of CPU_COUNT. If that switch/variable was not used, and cross compilation is not enabled, then one can try to use the $build system features; but even then you should be cautious about the result. > which attempt to get the number of CPUs in a system. I'd like to > extend it to cover Solaris, AIX and HP-UX. How do you find out this information on those systems? > It seems sensible to me to only do a test on a platform it will work > on, so I think thinking of something like > > if `uname` = "HP-UX" > write test for HP-UX > fi uname gives you $build system info. AC_CANONICAL_HOST sets $host which helps better, and gives fairly uniform info. See config.guess for a number of strings to match. > There's another macro I've seen used for determine cache sizes of > processors. > > http://www.nongnu.org/autoconf-archive/ax_cache_size.html This has similar problems. > which depends on the CPU being an x86 one, Not only that. IIUC it also depends on running on non-ancient Linux only. > which it will often not > be. I don't fancy the task of trying to work out cache sizes for > every processor used on machines running Solaris, AIX or HP-UX, so > will try to modify that so it returns a sensible guess (say 1 MB) on > processors it does not know about. The test is causing a script to > crash on HP-UX. HTH. Cheers, Ralf _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf