Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: charette@ultoe.det.dec.com (Mark Charette)
Subject: Re: How do I find machine & OS names in /lib/cpp?!
Date: 1995/07/06	[thread overview]
Message-ID: <3th62b$oqn@eccdb1.pms.ford.com> (raw)
In-Reply-To: danpop.804866315@rscernix

Dan Pop (Dan.Pop@mail.cern.ch) wrote:
: 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.

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



  reply	other threads:[~1995-07-06  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
1995-07-06  4:00   ` Mark Charette [this message]
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