From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a649e59da0d335b6 X-Google-Attributes: gidfee84,public From: charette@ultoe.det.dec.com (Mark Charette) Subject: Re: How do I find machine & OS names in /lib/cpp?! Date: 1995/07/06 Message-ID: <3th62b$oqn@eccdb1.pms.ford.com>#1/1 X-Deja-AN: 105732224 references: <3tb6f2$m4a@news.ox.ac.uk> organization: ECC at Ford Motor Company, Dearborn Michigan newsgroups: comp.unix.osf.osf1 Dan Pop (Dan.Pop@mail.cern.ch) wrote: : In <3tb6f2$m4a@news.ox.ac.uk> "Silas K.W. Denyer" writes: : >I am trying to compile some multi-platform software, using SDSC's sdscconfig.h, : >which is a machine characteristics file. I believe that the C preprocessor, : >/lib/cpp, will define a unique name for the machine & OS, allowing one to : >#ifdef in special code for it when needed. : > : >I am trying to compile this on a DEC 2100/A500MP Alpha AXP machine, running : >OSF/1, and _really_ need to know either what /lib/cpp wants to call it, or how : >do I find out! It seems that I have to be spot on with this or my code won't : >compile at all! Can anyone help....?! : The trick is to invoke cc with the -v option. It will display the cpp : command and you'll be able to get the information you need. To use the "trick", you probably needed to read the man page, which also states: ______________________________________________ Macro std0 std std1 (default) ____________________________________________ LANGUAGE_C yes no no __LANGUAGE_C__ yes yes yes unix yes no no __unix__ yes yes yes __osf__ yes yes yes __alpha yes yes yes SYSTYPE_BSD yes no no _SYSTYPE_BSD yes yes yes LANGUAGE_ASSEMBLY yes yes yes __LANGUAGE_ASSEMBLY__ yes yes yes ______________________________________________ : It seems that __alpha is what you need, or __alpha and __osf__ I'd use both. __alpha is defined on Alpha VMS C compilers. : You can use this trick on any Unix system to find out which system ^^^ ? : specific macros are defined when the preprocessor is invoked. Assuming that -v is supported on every Unix system, something I'm not really sure is a fact. I don't remember any ANSI/ISO committee (or even any de-facto industry committee) defining what should be supported as switches on C compilers, never mind whether or not they're even called cc. Surprising comment from you, Dan ;^) -- Mark Charette charette@mika.com MIKA Systems, Inc 17197 N. Laurel Park Dr Suite 115 Livonia, MI 48152