649 |
dnl ========================================================================== |
dnl ========================================================================== |
650 |
|
|
651 |
if test "$GCC" = "yes" ; then |
if test "$GCC" = "yes" ; then |
|
cat << EOF > test.c |
|
|
#include <stdio.h> |
|
|
int main(int argc, char **argv) |
|
|
{ |
|
|
if (*argv[[1]] == 'M') { |
|
|
printf("%d", __GNUC__); |
|
|
} |
|
|
if (*argv[[1]] == 'm') { |
|
|
printf("%d", __GNUC_MINOR__); |
|
|
} |
|
|
return 0; |
|
|
} |
|
|
EOF |
|
|
$CC -o gcc-ver test.c |
|
652 |
|
|
653 |
GCC_MAJOR=`./gcc-ver M` |
GCC_MAJOR=`$CC -dumpversion | cut -d . -f 1` |
654 |
GCC_MINOR=`./gcc-ver m` |
GCC_MINOR=`$CC -dumpversion | cut -d . -f 2` |
|
|
|
|
rm -f test.c |
|
|
rm -f gcc-ver |
|
655 |
|
|
656 |
# GCC 4.x |
# GCC 4.x |
657 |
if test "${GCC_MAJOR}" -gt 3 ; then |
if test "${GCC_MAJOR}" -gt 3 ; then |