3 # Copyright 2002, 2009, Harlan Stenn. Used by NTP with permission.
4 # Author: Harlan Stenn <harlan+cvo@pfcs.com>
6 # Possible output formats:
8 # CVO=... Shell variable
9 # CVO=... ; export CVO Old-style exported envariable
10 # export CVO=... New-style exported envariable
11 # setenv CVO ... csh-style exported envariable
15 CVO_raw
=`config.guess`
18 set 1 `echo $CVO | tr '-' ' '`
22 4) # eg: i686-pc-linux-gnu
25 cvo_KERN
=$3 # Note the capitalization...
28 linux
) # Braindamage. We want OS, not kernel info
32 elif test -f /etc
/debian_version
34 set `cat /etc/debian_version`
37 elif test -f /etc
/mandrake-release
39 set `cat /etc/mandrake-release`
42 elif test -f /etc
/redhat-release
44 set `cat /etc/redhat-release`
64 elif test -f /etc
/slackware-version
66 set `cat /etc/slackware-version`
69 elif test -f /etc
/SuSE-release
71 set `cat /etc/SuSE-release`
75 CVO_OS
=$cvo_KERN`uname -r`
83 echo "gronk - I don't understand <$CVO>!"
92 *) echo "gronk - config.guess returned $# pieces, not 3 pieces!"
99 # Decisions, decisions.
100 # uname -r is the cygwin version #, eg: 1.3.3(0.46/3/2)
101 # uname -s returns something like CYGWIN_NT-5.0
102 CVO_OS
="$CVO_OS`uname -r | sed 's/(.*//'`"
105 set `echo $CVO_OS | sed 's/\([0-9]\)/ \1/'`
109 *) echo "gronk - <$CVO_OS> expanded to $#, not 2 pieces!"
117 case "$CVO_OSNAME" in
119 CVO_KOSVER
=`uname -v`
123 CVO
=$CVO_CPU-$CVO_VENDOR-$CVO_OS
130 # keys['cvo'] = "cvo.CVO['CVO']"
131 TS
=`echo $TS | sed -e s/@cvo@/$CVO/g`
132 # keys['cpu'] = "cvo.CVO['CVO_CPU']"
133 TS
=`echo $TS | sed -e s/@cpu@/$CVO_CPU/g`
134 # keys['kosver'] = "cvo.CVO['CVO_KOSVER']"
135 TS
=`echo $TS | sed -e s/@kosver@/$CVO_KOSVER/g`
136 # keys['os'] = "cvo.CVO['CVO_OS']"
137 TS
=`echo $TS | sed -e s/@os@/$CVO_OS/g`
138 # keys['osname'] = "cvo.CVO['CVO_OSNAME']"
139 TS
=`echo $TS | sed -e s/@osname@/$CVO_OSNAME/g`
140 # keys['osver'] = "cvo.CVO['CVO_OSVER']"
141 TS
=`echo $TS | sed -e s/@osver@/$CVO_OSVER/g`
142 # keys['vendor'] = "cvo.CVO['CVO_VENDOR']"
143 TS
=`echo $TS | sed -e s/@vendor@/$CVO_VENDOR/g`
144 # keys['raw'] = "cvo.CVO['CVO_raw']"
145 TS
=`echo $TS | sed -e s/@raw@/$CVO_raw/g`