File: get-platform

package info (click to toggle)
mozilla-traybiff 1.2.3-4.3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 768 kB
  • ctags: 656
  • sloc: cpp: 1,840; ansic: 1,757; sh: 576; makefile: 236; perl: 123
file content (37 lines) | stat: -rwxr-xr-x 668 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

# Try to guess the Mozilla platform string.
# For now, we're unable to determine it from Mozilla itself.

if test -z "$CC"; then
    CC=cc
fi
PLATFORM=`uname -s`_
MACHINE=`uname -p 2>/dev/null`
if [ $? != 0 ]; then
	MACHINE=`uname -m`
fi
case $MACHINE in
*86)
	PLATFORM=${PLATFORM}x86
	;;
powerpc*)
	PLATFORM=${PLATFORM}ppc
	;;
Alpha | alpha | ALPHA)
	PLATFORM=${PLATFORM}Alpha
	;;
x86_64 | sparc | ppc | ia64)
	PLATFORM=${PLATFORM}${MACHINE}
	;;
esac

if ${CC} --version 2>/dev/null | grep GCC > /dev/null; then
	PLATFORM=${PLATFORM}-gcc3
else
    if ${CC} -V 2>&1 | grep 'Sun C' >/dev/null; then
	    PLATFORM=${PLATFORM}-sunc
    fi
fi

echo $PLATFORM