#!/bin/sh
# $Id: which-g++.sh,v 1.1 2005/07/23 22:59:46 devel Exp $
# Author: Jim E. Brooks  http://www.jimbrooks.org
#
# Pick the best g++ version.
# Eg, Debian 3 provides both "g++" (2.9.x) and "g++-3.0".
# FreeBSD's /bin/sh will stubbornly print "not found" regardless of redirection.
#-------------------------------------------------------------------------------

if [ "$CC" != "" ]; then
	echo "$CC"
elif ( g++3 --version >/dev/null 2>&1 ); then
    echo "g++3"
elif ( g++-3.0 --version >/dev/null 2>&1 ); then
	echo "g++-3.0"
else
	echo "g++"
fi
