Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!arisia!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.unix.wizards Subject: Re: generating code to run multiple targets Message-ID: <1038@quintus.UUCP> Date: 21 Apr 89 10:05:18 GMT References: <19190@adm.BRL.MIL> <1024@quintus.UUCP> <11319@tekecs.GWD.TEK.COM> Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 24 In article <11319@tekecs.GWD.TEK.COM> andrew@frip.wv.tek.com (Andrew Klossner) writes: >.>I posted a "machine" shell script last year which checks for a whole bunch of >.>machines, it was always the One Right UNIXy thing to have *one* command >.> machine # write the processor type to stdout >.>so that one would simply say >.> case `machine` of ... > >But this mechanism allows only one machine type. >On a Sun-3, for example, I would expect both 'sun' and 'm68k' to be true. It's precisely for Suns that I wanted it. We have Sun-2s, Sun-3s, Sun-4s, and a Sun-386i. The question I wanted an answer to was "which of my ~/bin/* directories shall I put in my $PATH", and the answer is PATH=$HOME/bin/`machine`:$PATH /bin/arch would have been ideal, except that our Sun-2s run SunOS 2.3, which hasn't got /bin/arch. Similarly, knowing that a machine is an Apollo machine isn't enough. Even knowing that it is an Apollo and an m68k rather than a DN10000 isn't enough. You don't want to try executing 68020 instructions on a 68010. (Apollo have a $NODETYPE which tells you what you want to know, and my script echoes it if it can.) I don't claim that this is the only question you want to answer, only that it provides users with a single place to look for the answer to this particular question, no matter which of our machines is used.