Skip to content

Commit 8abe5e3

Browse files
committed
Support both 32 and 64-bit platforms.
1 parent 62ac9fd commit 8abe5e3

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

content/install-snet

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ export LPEL_REPO=https://github.com/snetdev/lpel.git
2626
# Where to get SNET-RTS from
2727
export SNET_REPO=https://github.com/snetdev/snet-rts.git
2828

29-
# Where to get the S-Net compiler for Linux
30-
export COMPILER="https://github.com/snetdev/releases/blob/master/2013/snetc-20130425.x86_64.bz2?raw=true"
29+
# Where to get the S-Net compiler
30+
export COMPILER_LINUX_64="https://raw.github.com/snetdev/releases/master/2013/snetc-20130507.x86_64.bz2"
31+
export COMPILER_LINUX_32="https://raw.github.com/snetdev/releases/master/2013/snetc-20130507.i686.bz2"
3132

3233
mkdir -p $PCL_PREFIX $LPEL_PREFIX $SNET_PREFIX
3334

@@ -112,14 +113,23 @@ function build_snet_rts () {
112113
}
113114

114115
function get_snetc () {
115-
raw=${COMPILER##*/}
116-
bz2=${raw%\?*}
117-
snc=${bz2%.bz2}
118-
rm -fv -- "$raw" "$bz2" "$snc"
119-
wget "$COMPILER"
120-
mv -f "$raw" "$bz2"
121-
bunzip2 "$bz2"
122-
chmod +x "$snc"
116+
case "`uname -p`" in
117+
i?86) COMPILER=$COMPILER_LINUX_32 ;;
118+
x86_64) COMPILER=$COMPILER_LINUX_64 ;;
119+
*) echo "$0: Unknown platform. Not downloading a compiler..." ;;
120+
esac
121+
if [ "$COMPILER" != "" ]; then
122+
raw=${COMPILER##*/}
123+
bz2=${raw%\?*}
124+
snc=${bz2%.bz2}
125+
rm -fv -- "$raw" "$bz2" "$snc"
126+
wget "$COMPILER"
127+
if [ "$raw" != "$bz2" ]; then
128+
mv -f "$raw" "$bz2"
129+
fi
130+
bunzip2 "$bz2"
131+
chmod +x "$snc"
132+
fi
123133
}
124134

125135
function show_env () {

0 commit comments

Comments
 (0)