Telling csh about multiple, machine-dependent libraries

Juergen Wagner gandalf at csli.STANFORD.EDU
Fri Nov 18 15:05:52 AEST 1988


In article <14592 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>...
>This should work.  If you have the `machine' command (and it does
>the right thing) you can also use
>...
>	set mtype = `machine`
>...

On our Sun4, the "arch" command is what your "machine" command is. The point
is, different machine architectures might use different commands. The way I
am finding out what machine type I am on is quite simple (though a bit more
CPU expensive than a short script):

  setenv HOSTTYPE "`/lib/cpp -P < ${HOME}/conf/hosttype`"

where the file ~/conf/hosttype contains something like
    # undef ok
    # ifndef ok
    # if sun
    # undef sun
    #   ifdef sparc
    #   undef sparc
    sparc
    #   else
    sun
    #   endif
    # define ok
    # endif
    # endif
    ...
    # ifndef ok
    unknown
    # endif

This uses the guaranteed feature of cpp to have the predefined symbols "sun",
"sparc", "vax", "hpux", etc. Everything else seemed to be different across
machine architectures.

-- 
Juergen Wagner		   			gandalf at csli.stanford.edu
						 wagner at arisia.xerox.com



More information about the Comp.unix.questions mailing list