platform at [b218be3c25]

File server/buildpkgs/platform artifact 828b4fc7e9 part of check-in b218be3c25


#! /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 .)
		SOLVER="$[${SUNMAJVER} - 3].${SUNMINVER}"


		case "`uname -m`" in
			sun4?)
				CPUPLAT="sparc"
				;;
			*)
				CPUPLAT="ix86"
				;;
		esac

		echo "solaris${SOLVER}-${CPUPLAT}"
		;;
	*)
		echo "`uname -s | dd conv=lcase 2>/dev/null`-`uname -m | dd conv=lcase 2>/dev/null`"
		;;
esac