From: Dan.Pop@mail.cern.ch (Dan Pop)
Subject: Re: How do I find machine & OS names in /lib/cpp?!
Date: 1995/07/04 [thread overview]
Message-ID: <danpop.804866315@rscernix> (raw)
In-Reply-To: 3tb6f2$m4a@news.ox.ac.uk
In <3tb6f2$m4a@news.ox.ac.uk> "Silas K.W. Denyer" <silas.denyer@eng.ox.ac.uk> 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
next prev parent reply other threads:[~1995-07-04 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-07-04 4:00 How do I find machine & OS names in /lib/cpp?! Silas K.W. Denyer
1995-07-04 4:00 ` Dan Pop [this message]
1995-07-06 4:00 ` Mark Charette
1995-07-06 4:00 ` Dan Pop
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox