63 |
else |
else |
64 |
AC_PATH_PROG(GCJ, "gcj") |
AC_PATH_PROG(GCJ, "gcj") |
65 |
fi |
fi |
66 |
|
dnl Test the given GCJ, but use it as C (!) compiler to check version |
67 |
if test "x$GCJ" != x; then |
if test "x$GCJ" != x; then |
68 |
## GCC version 2 puts out version messages that looked like: |
AC_MSG_CHECKING([gcj version 4.0]) |
69 |
## 2.95 |
AC_LANG_PUSH([C]) |
70 |
|
AC_LANG_CONFTEST( |
71 |
## GCC version 3 puts out version messages like: |
[[#if __GNUC__ <= 3 |
72 |
## gcj (GCC) 3.3.3 |
#error GCJ 4.0.0 or higher is required |
73 |
## Copyright (C) 2003 Free Software Foundation, Inc. |
#endif |
74 |
## This is free software; see the source for copying conditions. There is NO |
]]) |
75 |
## warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
$GCJ -E conftest.c > /dev/null |
76 |
AC_MSG_CHECKING(gcj version) |
gcj_4_result=$? |
77 |
## Take the output from gcj --version and extract just the version number |
if test "x$gcj_4_result" = "x0"; then |
78 |
## into GCJ_VERSION. |
AC_MSG_RESULT([4.0 or higher found]) |
|
## (we need to do this to be compatible with both GCC 2 and GCC 3 version |
|
|
## numbers) |
|
|
## |
|
|
## First, we get rid of everything before the first number on that line. |
|
|
## Assume that the first number on that line is the start of the |
|
|
## version. |
|
|
## |
|
|
## Second, while we're at it, go ahead and get rid of the first character |
|
|
## that is not part of a version number (i.e., is neither a digit nor |
|
|
## a dot). |
|
|
## |
|
|
## Third, quit, so that we won't process the second and subsequent lines. |
|
|
GCJ_VERSION=`$GCJ --version | sed -e 's/^@<:@^0-9@:>@*//' -e 's/@<:@^.0-9@:>@@<:@^.0-9@:>@*//' -e 'q'` |
|
|
GCJ_VERSION_MAJOR=`echo "$GCJ_VERSION" | cut -d '.' -f 1` |
|
|
GCJ_VERSION_MINOR=`echo "$GCJ_VERSION" | cut -d '.' -f 2` |
|
|
|
|
|
if expr "$GCJ_VERSION_MAJOR" \< 3 > /dev/null; then |
|
|
GCJ="" |
|
|
fi |
|
|
if expr "$GCJ_VERSION_MAJOR" = 3 > /dev/null; then |
|
|
if expr "$GCJ_VERSION_MINOR" \< 3; then |
|
|
GCJ="" |
|
|
fi |
|
|
fi |
|
|
if test "x$GCJ" != x; then |
|
|
AC_MSG_RESULT($GCJ_VERSION) |
|
79 |
else |
else |
80 |
AC_MSG_WARN($GCJ_VERSION: gcj 3.3 or higher required) |
AC_MSG_WARN([4.0 or higher required]) |
81 |
fi |
fi |
82 |
|
AC_LANG_POP |
83 |
fi |
fi |
84 |
]) |
]) |
85 |
|
|