Re-add getgccver but a completely different version. This is to cope with all

OS I tried it on (Solaris, OSX, Linux, NetBSD, FreeBSD) and various gcc flavours
including weird ones like "3.5-blah".
edge.strict_endians
antona 2005-10-15 11:14:43 +00:00
parent be4c70b45e
commit 01a929556c
2 changed files with 30 additions and 3 deletions

View File

@ -240,9 +240,9 @@ fi
# Check for gcc version being >= 2.96.
AC_MSG_CHECKING(version of $_cc)
cc_version=`$_cc -dumpversion 2> /dev/null | head -n 1`
cc_major=`echo $cc_version | cut -d'.' -f1 | sed s/"^\([0-9]+\).*$"/"\1"/`
cc_minor=`echo $cc_version | cut -d'.' -f2 | sed s/"^\([0-9]+\).*$"/"\1"/`
cc_version=`getgccver $_cc version`
cc_major=`getgccver $_cc major`
cc_minor=`getgccver $_cc minor`
if test -z "$cc_version"; then
cc_version="v. ?.??"
cc_major=1

27
getgccver 100755
View File

@ -0,0 +1,27 @@
#!/bin/sh
if test -z "$1"; then
echo "This program is only to be run by the ./configure script."
exit 1
fi
# Get the gcc version. Can't do this in configure.ac as automake refuses to
# preserve the square brackets while generating the configure script.
ver_str=`$1 -dumpversion 2> /dev/null | head -n 1`
case $2 in
version)
echo ${ver_str}
;;
major)
echo `echo ${ver_str} | cut -d'.' -f1 | sed s/"^\([0-9]*\).*$"/"\1"/`
;;
minor)
echo `echo ${ver_str} | cut -d'.' -f2 | sed s/"^\([0-9]*\).*$"/"\1"/`
;;
*)
echo "This program is only to be run by the ./configure script."
exit 1
;;
esac
exit 0