NetBSD/dist/am-utils/config.guess.long

74 lines
1.8 KiB
Plaintext
Raw Normal View History

#!/bin/sh
# generate long version of output from config.guess
# part of am-utils-6.x
# Erez Zadok <ezk@cs.columbia.edu>
#
2003-03-09 04:12:05 +03:00
#set -x
# find a single word that prints the version number of the release
2005-09-20 21:12:54 +04:00
getver () {
2003-03-09 04:12:05 +03:00
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
2005-09-20 21:12:54 +04:00
long=`getver /etc/redhat-release`
2005-04-23 22:07:47 +04:00
if grep -q 'Red Hat Enterprise Linux' /etc/redhat-release; then
echo ${GCONFIG}-rhel${long}
elif grep -q 'Fedora Core' /etc/redhat-release; then
2004-11-27 04:00:29 +03:00
echo ${GCONFIG}-fc${long}
else
echo ${GCONFIG}-rh${long}
fi
exit 0
2002-11-30 01:57:11 +03:00
elif test -f /etc/SuSE-release ; then
2005-09-20 21:12:54 +04:00
long=`getver /etc/SuSE-release`
if grep -q 'Enterprise Server' /etc/SuSE-release; then
echo ${GCONFIG}-sles${long}
else
echo ${GCONFIG}-suse${long}
fi
2002-11-30 01:57:11 +03:00
exit 0
2004-11-27 04:00:29 +03:00
elif test -f /etc/debian_version ; then
2005-09-20 21:12:54 +04:00
long=`getver /etc/debian_version`
2004-11-27 04:00:29 +03:00
echo ${GCONFIG}-deb${long}
exit 0
2005-09-20 21:12:54 +04:00
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