autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to test if preprocessor defines foobar in macro?


From: Mike Frysinger
Subject: Re: How to test if preprocessor defines foobar in macro?
Date: Wed, 14 Oct 2009 01:30:06 -0400
User-agent: KMail/1.12.1 (Linux/2.6.31; KDE/4.3.1; x86_64; ; )

On Wednesday 14 October 2009 00:36:36 Dr. David Kirkby wrote:
> I'm trying to modify this macro
> 
> http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m
> 4/ax_count_cpus.m4
> 
> which attempt to get the number of CPUs in a system. I'd like to extend
> it to cover Solaris, AIX and HP-UX.

there are so many reasons why this is wrong (some of which people have pointed 
out).  you havent really said why you want this information, but presumably it 
isnt for usage in the configure script (since that's about the only place this 
info would be valid).  if it's being passed to source code, you should be 
querying the proc count at runtime with sysconf(_SC_NPROCESSORS_CONF).  if 
your system isnt POSIX complaint, then usually it provides some other way of 
getting this info.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]