Re: System Ids

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Sun, 05 Nov 1995 15:29:23 +0000

David Fox writes:


> Stefan Monnier writes:
>
> > David Fox <fox_at_GRAPHICS.CS.NYU.EDU> wrote: > We have lots of suns
> > and sgis around here, and STk needs to merge the > system
> > directories for those machines the way it does for Linux. I >
> > suggest adding to the launch scripts:
> >
> > If you really want to add specific code for every architecture
> > under the sun, go ahead, but I personnally much prefer keeping the
> > code simple and machine independent by doing that kind of
> > translating with links like
> >
> > IRIX-5.3-IP26 -> IRIX-5.3-IP22
> >
> > Of course, this probably requires human intervention, but I much
> > prefer that to a script that tries to be too smart.
>
> But you end up looking pretty bad when you try to demo your program to
> someone who sits in front of our only Reality Engine all day and have
> to explain why he needs to su to me, cd to some obscure directory like
> /graphics.b/fox/local/lib/stk/3.0b1 and type "ln -s IRIX-5.3-IP22
> IRIX64-6.0.1-IP26" etc etc. What's the worst a smart script could
> do? Make the program fail? It does that anyway.
>

I agree with you (I fall in the situation you describe several times
too) and with Stephan (a script must not try to be too smart).
However, the various sub-releases of a system don't affect a lot a
program such as STk (hopefully). Hereafter is a shell script which
correspond to the work done during configure to find the system
signature. Note that in next release, there will be no more shell
script to launch STk and the interpreter doesn't anymore contain hard
path (i.e. the STk tree can be placed everywhere in the hierarchy, the
interpreter will find necessary files relatively to its place in the
Unix tree). BTW, this should permit binary distributions of STk.

Are there other things to add in add in this scrripts for other systems
(Is suspect that OSF 3 systems can be merged but I'm not sure).

#!/bin/sh
#
# This script defines a "clever" signature for the running system. It
# displays a name which identifies the system.

os=`uname -s`
version=`uname -r`
machine=`uname -m`

case $os in
  Linux*)
          case $version in
            1.*) version=1.X;;
          esac
          case $machine in
            i*86) machine=ix86;;
          esac;;
  SunOS*)
          case $version in
            4.1.*) version=4.1.X;;
          esac
          case $machine in
            sun4*) machine=sun4;;
          esac;;
  IRIX*)
          case $version in
            5.*) version=5.X;;
            6.*) version=6.X;;
          esac
          case $machine in
           IP*) machine=IPxx;;
          esac;;
esac

echo "Signature for your system is '$os-$version-$machine'"





                -- Erick
Received on Sun Nov 05 1995 - 15:29:24 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST