Re(cap): Which Unix?

Roger Southwick rogers at dadla.UUCP
Wed Apr 24 11:57:40 AEST 1985


[No matter where you go..... there you are.  Buckaroo Banzai]

Dear Fellow Gurus,

	I realize I'll probably get lots of flames for
asking this observation (question) and making a (minor) suggestion,
but here goes:

It seems to me that (when this was bandied about on the net
a few weeks ago) there never was a EASY method for determining
which version of UN*X a program was being compiled under.

I seem to remember a few suggested methods, but I don't ever
recall ONE method which would work under all cases (or did
I miss this?).

Anyway, given that there (probably) wasn't one submitted,
I'd like to make the below suggested method for you all
to consider, and make comment on.  Please send me mail
(don't post to the net) and I'll (try to) summarize and
make a final posting later.

What I'm proposing is for ALL UN*X systems to have a single
(additional) include file: /usr/include/unix.h, which would
contain something like:

   /*
    * This file contains a definition for the type 
    * of Unix this machine is running under.
    *
    * There are defines for most known types of Unix
    * and then the UNIX define is set up in terms
    * of this.
    */

   #define V6		0
   #define PWB		1
   #define V7		2
   #define SYS3		3
   #define 32V		4
   #define BSD2_8	5
   #define BSD4_1	6
   #define SYS5		7
   #define BSD2_9	8
   #define BSD4_2	9
   #define ULTRIX	10
   #define P1003	11	/* /usr/group standard	*/
    ...

   #define UNIX		BSD4_2

Anyway,  you get the idea.  Then all programs would have to do
is to include this file, then have lines like:

   #if UNIX == BSD4_2

I've tried (in the above) to basically stick to a cronological
order as best as I can remember, (forgive me if I've got them
out of order a bit) and I think this may be as good as any
approach to future defines.

Anyway, what do you all think?

		-Roger


UUCP:			...!tektronix!dadla!rogers

CSnet:			rogers%dadla at tektronix

ARPAnet:		rogers%dadla%tektronix at csnet-relay

BELLnet (phone):	(503)-629-1911

SNAILnet (U.S. Mail):	Roger Southwick
			Tektronix, Inc.
			P.O. Box 4600, D.S. 92-731
			Beaverton, Oregon 97075



More information about the Comp.unix.wizards mailing list