+set_VENDOR_RELEASE ()
+{
+ local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
+ case "$VENDOR_DISTRIBUTION" in
+ darwin)
+ VENDOR_RELEASE='mountain'
+ ;;
+ fedora)
+ VENDOR_RELEASE="$release"
+ ;;
+ rhel)
+ VENDOR_RELEASE="$release"
+ ;;
+ ubuntu)
+ VENDOR_RELEASE="$release"
+ ;;
+ opensuse)
+ VENDOR_RELEASE="$release"
+ ;;
+ unknown)
+ die "attempt to set VENDOR_RELEASE without setting VENDOR_DISTRIBUTION"
+ ;;
+ *)
+ die "attempt to set with an invalid VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION"
+ ;;
+ esac
+}
+
+
+# Valid values are: apple, redhat, centos, canonical
+set_VENDOR ()
+{
+ local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`
+
+ case $vendor in
+ apple)
+ VENDOR='apple'
+ ;;
+ redhat)
+ VENDOR='redhat'
+ ;;
+ centos)
+ VENDOR='centos'
+ ;;
+ canonical)
+ VENDOR='canonical'
+ ;;
+ suse)
+ VENDOR='suse'
+ ;;
+ *)
+ die "An attempt was made to set an invalid VENDOR=$_vendor"
+ ;;
+ esac
+
+ set_VENDOR_DISTRIBUTION $2
+ set_VENDOR_RELEASE $3
+}
+
+determine_target_platform ()
+{
+ UNAME_MACHINE_ARCH=`(uname -m) 2>/dev/null` || UNAME_MACHINE_ARCH=unknown
+ UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown
+
+ if [[ $(uname) == 'Darwin' ]]; then
+ set_VENDOR 'apple' 'darwin' 'mountain'
+ elif [[ -f '/etc/fedora-release' ]]; then
+ local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`
+ set_VENDOR 'redhat' 'fedora' $fedora_version
+ if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then
+ AUTORECONF_REBUILD_HOST=true
+ fi
+ elif [[ -f '/etc/centos-release' ]]; then
+ local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`
+ set_VENDOR 'centos' 'rhel' $centos_version
+ elif [[ -f '/etc/SuSE-release' ]]; then
+ local suse_distribution=`head -1 /etc/SuSE-release | awk ' { print $1 } '`
+ local suse_version=`head -1 /etc/SuSE-release | awk ' { print $2 } '`
+ set_VENDOR 'suse' $suse_distribution $suse_version
+ elif [[ -f '/etc/redhat-release' ]]; then
+ local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`
+ set_VENDOR 'redhat' 'rhel' $rhel_version
+ elif [[ -f '/etc/lsb-release' ]]; then
+ local debian_DISTRIB_ID=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '`
+ local debian_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '`
+ set_VENDOR 'canonical' $debian_DISTRIB_ID $debian_version
+ if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
+ AUTORECONF_REBUILD_HOST=true
+ fi