Xref: utzoo comp.sys.mips:362 comp.unix.ultrix:2351 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!cs.utexas.edu!sun-barr!decwrl!crltrx!treese From: treese@crltrx.crl.dec.com (Win Treese) Newsgroups: comp.sys.mips,comp.unix.ultrix Subject: Re: Distinguishing "true" MIPS box from DECstation at compile time Message-ID: <1435@crltrx.crl.dec.com> Date: 16 Dec 89 02:02:17 GMT References: <1300@uakari.primate.wisc.edu> Reply-To: treese@crltrx.crl.dec.com.UUCP (Win Treese) Organization: DEC Cambridge Research Lab Lines: 28 In article <1300@uakari.primate.wisc.edu> bin@primate.wisc.edu (Brain in Neutral) writes: >How does one tell, when compiling a C program, whether the host is a >true MIPS machine (e.g., M/120) from a DECstation that's running >Ultrix. I think I remember reading an article a while back that >complained about "mips" being defined by the preprocessor even on >Ultrix machines. Is this true? If so, is the test According to the Ultrix/RISC manual page for cc, the following symbols are defined (may change when ANSI C rolls around): unix Any UNIX system bsd4_2 Berkeley UNIX Version 4.2 ultrix ULTRIX only mips Any MIPS architecture MIPSEL Little endian variant of MIPS architecture host_mips Native compilation environment (as opposed to cross-compiler) If I'm being specific to Digital's RISC machines, I'd use #if defined(mips) && defined(ultrix) #endif Actually, I'd probably stuff that kind of thing into machine/system-specific configuration files and #ifdef based on feature. Win Treese Cambridge Research Lab treese@crl.dec.com Digital Equipment Corp.