Distinguishing "true" MIPS box from DECstation at compile time

Hugh LaMaster lamaster at ames.arc.nasa.gov
Fri Dec 22 12:00:23 AEST 1989


In article <2103 at odin.SGI.COM> msc at sgi.com writes:
>In article <89Dec15.145750est.2273 at neat.cs.toronto.edu>,
>Even though the system vendors don't define "feature ifdefs" you can write
>your code as if you had them.  You simply have to create a header that does
>all the ugly stuff (like that in the rest of the referenced article) and
>sets the appropriate "featuredefs".

I agree with most of what is written here, but, I sure could use a standard
way to determine from the shell what architecture of machine I am on.

I wish, for example, that the "arch" command could be made universal, and
would return a string which has 2 simple components.  For example:

sun3
sun4

decvax
decmips

sgimips

(or whatever you want, as long as it is unique).

BTW, I currently use if [] tests on files to guess,  when something
else is not available, but this doesn't work
reliably because of differences in filesystem mounts, which optional 
software is loaded, etc.


  Hugh LaMaster, m/s 233-9,  UUCP ames!lamaster
  NASA Ames Research Center  ARPA lamaster at ames.arc.nasa.gov
  Moffett Field, CA 94035     
  Phone:  (415)694-6117       



More information about the Comp.unix.ultrix mailing list