1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#! /bin/bash
case "`uname -s`" in
Linux)
GLIBCVERS=$(strings /lib/libc.so.6 | grep '^GLIBC_[0-9][0-9]*\.[0-9]*' | cut -f 2- -d _ | cut -f 1-2 -d . | sed 's@\.@ @g' | sort -n +0 +1 | tail -1 | sed 's@ @\.@g')
case "`uname -m`" in
i?86)
CPUPLAT="ix86"
;;
sun4?)
CPUPLAT="sparc"
;;
*)
CPUPLAT="`uname -m`"
;;
esac
echo "linux-glibc${GLIBCVERS}-${CPUPLAT}"
;;
SunOS)
SUNMAJVER=$(uname -r | cut -f 1 -d .)
SUNMINVER=$(uname -r | cut -f 2 -d .)
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
<
<
|
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
|
#! /bin/bash
MAGICFILEFILE="$0.magic.file"
MAGICOSFILE="$0.magic.os"
MAGICPLATFILE="$0.magic.platform"
OSNAME="`uname -s`"
CPUPLAT="`uname -m`"
if [ -f "${MAGICFILEFILE}" -a -f "${MAGICOSFILE}" -a -f "${MAGICPLATFILE}" ]; then
MAGICPLAT="$(cat "${MAGICPLATFILE}")"
MAGICOS="$(cat "${MAGICOSFILE}")"
MAGICFILE="$(cat "${MAGICFILEFILE}" | dd conv=lcase 2>/dev/null)"
case "${MAGICPLAT}" in
unix)
case "${MAGICFILE}" in
*elf*x86-64*)
CPUPLAT="x86_64"
;;
*elf*intel\ 80386*)
CPUPLAT="ix86"
;;
*parisc*)
CPUPLAT="parisc"
;;
*elf*32-bit*sparc*)
CPUPLAT="sparc"
;;
*elf*64-bit*sparc*)
CPUPLAT="sparc64"
;;
esac
if [ "${MAGICOS}" != "`uname -s`" ]; then
# Cross compiling, try to determine OS ...
true
fi
;;
win)
if grep "64-bit" "${MAGICFILEFILE}" >/dev/null; then
echo "win32-x86_64"
else
echo "win32-ix86"
fi
exit 0
;;
macosx)
;;
esac
fi
case "${OSNAME}" in
Linux)
GLIBCVERS=$(strings /lib/libc.so.6 | grep '^GLIBC_[0-9][0-9]*\.[0-9]*' | cut -f 2- -d _ | cut -f 1-2 -d . | sed 's@\.@ @g' | sort -n +0 +1 | tail -1 | sed 's@ @\.@g')
case "${CPUPLAT}" in
i?86)
CPUPLAT="ix86"
;;
sun4?)
CPUPLAT="sparc"
;;
esac
echo "linux-glibc${GLIBCVERS}-${CPUPLAT}"
;;
SunOS)
SUNMAJVER=$(uname -r | cut -f 1 -d .)
SUNMINVER=$(uname -r | cut -f 2 -d .)
|