forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmsos.file
86 lines (82 loc) · 2.76 KB
/
cmsos.file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
### FILE cmsos
cmsos()
{
# Determine the cpu architecture string.
case `uname -p` in
i*86) cpuarch=ia32 ;;
x86_64) cpuarch=amd64 ;;
*EMT*) cpuarch=amd64 ;;
armv7l) cpuarch=armv7hl ;; # The kernel is armv7l, but we assume system as armv7hl (hard floats)
aarch64) cpuarch=aarch64 ;;
*) cpuarch=`uname -p`;;
esac
if [ "X$BUILD_ARCH" != X ]; then
echo "$BUILD_ARCH"
elif [ "X`uname -p`" = Xppc64 ]; then
# hard code this, should be done better
echo ydl5_ppc64
elif [ "X`uname`" = XLinux ]; then
if [ "X`uname -i`" = Xppc ]; then
# hard code this, should be done better
echo ydl5_ppc
elif [ -f /etc/SuSE-release ]; then
echo suse`grep -i '^version' < /etc/SuSE-release | tr -dc '[0-9]'`
elif [ -f /etc/fedora-release ]; then
echo fc`sed 's/[^0-9]//g' /etc/fedora-release`_${cpuarch}
elif egrep -q "Red Hat Enterprise|Scientific|CentOS" /etc/redhat-release 2>/dev/null; then
slc_version=`egrep "Red Hat Enterprise|Scientific|CentOS" /etc/redhat-release | \
sed 's/.*[rR]elease \([0-9]*\).*/\1/'`
if [ "X`uname -i`" = Xi386 ]; then
echo slc${slc_version}_ia32
else
echo slc${slc_version}_amd64
fi
elif grep -q Scientific /etc/rocks-release 2>/dev/null; then
slc_version=`grep DISTRIB_RELEASE rocks-release | sed 's/DISTRIB_RELEASE="\([0-9]*\).*/\1/'`
# For the moment we assume that they are all ia32
# if grep -q Intel /proc/cpuinfo 2>/dev/null; then
echo slc${slc_version}_ia32
# else
# echo slc${slc_version}_amd64
# fi
elif grep -q PU_IAS /etc/redhat-release 2>/dev/null; then
echo slc4_$cpuarch
else
archos= archosv=
for f in debian_version slackware-version fedora-release \
redhat-release altlinux-release gentoo-release \
cobalt-release mandrake-release conectiva-release; do
if [ -f /etc/$f ]; then
archos=`echo $f | sed 's/[-_].*//'`
archosv=`tr -dc '[0-9]' < /etc/$f`
break
fi
done
[ X$archos = Xredhat ] && archos=rh
if [ -z "$archos" -o -z "$archosv" ]; then
echo linux`uname -r | cut -d. -f1,2 | tr -d .`_$cpuarch
else
echo $archos$archosv_$cpuarch
fi
fi
elif [ "X`uname`" = XDarwin ]; then
case `sysctl hw.cpu64bit_capable | cut -f2 -d\ ` in 1) cpuarch=amd64;; 0) cpuarch=ia32;; esac
echo osx`sw_vers -productVersion | cut -d. -f1,2 | tr -dc [0-9]`_$cpuarch
elif [ "X`uname | cut -d_ -f1`" = XCYGWIN ]; then
echo win32_$cpuarch
else
echo unsupported
fi
}
defaultCompiler()
{
case `cmsos` in
slc4* ) echo gcc345 ;;
slc5* ) echo gcc432 ;;
osx104* ) echo gcc400 ;;
osx105* ) echo gcc401 ;;
osx106* ) echo gcc421 ;;
* ) echo gcc345 ;;
esac
}
cmsos