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: Dan.Pop@mail.cern.ch (Dan Pop) Subject: Re: How do I find machine & OS names in /lib/cpp?! Date: 1995/07/04 Message-ID: #1/1 X-Deja-AN: 105619480 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <3tb6f2$m4a@news.ox.ac.uk> organization: CERN European Lab for Particle Physics newsgroups: comp.unix.osf.osf1 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. ues5:~/tmp 12> cc -v -E test.c >/dev/null /usr/lib/cmplrs/cc/cfe -E -Xv test.c -DLANGUAGE_C -D__LANGUAGE_C__ -D_CFE -Dunix -D__unix__ -D__osf__ -D_LONGLONG -D__alpha -D__DSO__ -DSYSTYPE_BSD -D_SYSTYPE_BSD -I/usr/include3.11 It seems that __alpha is what you need, or __alpha and __osf__ You can use this trick on any Unix system to find out which system specific macros are defined when the preprocessor is invoked. Dan -- Dan Pop CERN, CN Division Email: Dan.Pop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland