Subject: Re: SunOS vs SOLARIS

From: [email-masked] (John Martinez)
Date: Sat, 7 May 1994 04:13:57 GMT

Marc Wiese ([email-masked]) wrote:

: I have written a C file and compiled it for SunOS4.x and ULTRIX.

: acc -o xxx  file.c

: I moved both file to one directory.

: eg  ~/bin
:         xxx.SunOS
:                 xxx.ULTRIX

: From now on, it is possible to invoke this program on SunOS4.x or ULTRIX with

: ~/bin/xxx.`uname`

: Question:
: =========
: Now I have to support three versions ULTRIX,SunOS(4.x) and SOLARIS(2.x).

: But invoking the command "uname" will display the same result on Sol(2.x) and
: SunOS(4.x).

: How should I cope this problem?

: Kind Regards

: Wiese Marc

: Alcatel Bell
: Antwerp

The way I do it (and what i learned from a System Progammer I used to work 
with), was to make in your bin directory, and architecture specific bin (and
even OS specific with SunOS4.x and Solaris2.x).

i.e.
     ~/bin
        bin.sun4.4.1.3
        bin.sun4.5.3

Make a "wrapper" shell script that will test for architecture and OS. Read
the man page for uname, this is the only real command you need to use. Link
the wrapper script (I used to call it .wrap) to the name of the program.

i.e.
     ~/bin/gcc -> .wrap (or ln -s .wrap gcc)
     which will exec
        bin.sun4.4.1.3/gcc
              *or*
        bin.sun4.5.3/gcc
        
Sorry I don't have an example of this wrapper script (I work in only 4.1.3 now
and I left my copy at my old site).

The other examples should help you though...

good luck.

-john
-- 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
%    John Martinez ([email-masked]) UNIX System Administration Services    %
%                BreakAway Technology Services, San Jose, CA                  %
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<