-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.guess.long
executable file
·73 lines (71 loc) · 1.82 KB
/
config.guess.long
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
#!/bin/sh
# generate long version of output from config.guess
# part of am-utils-6.x
# Erez Zadok <[email protected]>
#
#set -x
# find a single word that prints the version number of the release
getver () {
l=`head $1`
set $l
for i in $*
do
case "$i" in
# look for one digit followed by a sequence of non-spaces
# so it'll catch 7.3 as well as 2.1AW
*[0-9]* ) echo $i; return ;;
esac
done
}
if test "x$GCONFIG" = "x" ; then
# find dirname of this script
base=`echo $0 | sed 's/\/[^\/]*$//' 2>/dev/null`
PATH=$base:$PATH
export PATH
GCONFIG=`config.guess || echo unknown-config`
fi
case "${GCONFIG}" in
*linux* )
GCONFIG=`echo ${GCONFIG} | sed -e 's/i.86/i386/' -e 's/linux-gnu/linux/'`
if test -f /etc/redhat-release ; then
long=`getver /etc/redhat-release`
if grep -q 'Red Hat Enterprise Linux' /etc/redhat-release; then
echo ${GCONFIG}-rhel${long}
elif grep -q 'Fedora Core' /etc/redhat-release; then
echo ${GCONFIG}-fc${long}
else
echo ${GCONFIG}-rh${long}
fi
exit 0
elif test -f /etc/SuSE-release ; then
long=`getver /etc/SuSE-release`
if grep -q 'Enterprise Server' /etc/SuSE-release; then
echo ${GCONFIG}-sles${long}
else
echo ${GCONFIG}-suse${long}
fi
exit 0
elif test -f /etc/debian_version ; then
long=`getver /etc/debian_version`
echo ${GCONFIG}-deb${long}
exit 0
elif test -f /etc/gentoo-release ; then
long=`getver /etc/gentoo-release`
echo ${GCONFIG}-gentoo${long}
exit 0
elif test -f /etc/yellowdog-release ; then
long=`getver /etc/yellowdog-release`
echo ${GCONFIG}-yellowdog${long}
exit 0
else
echo ${GCONFIG}
fi
;;
*netbsdelf3* ) # remove trailing '.' from beta
echo ${GCONFIG} | sed 's/\.$//g'
;;
* )
echo ${GCONFIG}
;;
esac
exit 0