diff options
author | Mark Wielaard <mark@klomp.org> | 2005-09-11 23:20:18 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2005-09-11 23:20:18 +0000 |
commit | 14fee010d6f9d423fba4b4670abc91083a3f3f57 (patch) | |
tree | 098b4ad3a943adce6d16c991246ff24a2c862842 /m4 | |
parent | 9112002816fbf81aa23ac90bb260258e8353f537 (diff) | |
download | classpath-14fee010d6f9d423fba4b4670abc91083a3f3f57.tar.gz |
* m4/acinclude.m4 (CLASSPATH_CHECK_GCJ): Check for gcj 4 with
#if __GNUC__ <= 3.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/acinclude.m4 | 53 |
1 files changed, 14 insertions, 39 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index e05a2f8e7..e41321f89 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -63,48 +63,23 @@ AC_DEFUN([CLASSPATH_CHECK_GCJ], else AC_PATH_PROG(GCJ, "gcj") fi - + dnl Test the given GCJ, but use it as C (!) compiler to check version if test "x$GCJ" != x; then - ## GCC version 2 puts out version messages that looked like: - ## 2.95 - - ## GCC version 3 puts out version messages like: - ## gcj (GCC) 3.3.3 - ## Copyright (C) 2003 Free Software Foundation, Inc. - ## This is free software; see the source for copying conditions. There is NO - ## warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - AC_MSG_CHECKING(gcj version) - ## Take the output from gcj --version and extract just the version number - ## into GCJ_VERSION. - ## (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) + AC_MSG_CHECKING([gcj version 4.0]) + AC_LANG_PUSH([C]) + AC_LANG_CONFTEST( + [[#if __GNUC__ <= 3 + #error GCJ 4.0.0 or higher is required + #endif + ]]) + $GCJ -E conftest.c > /dev/null + gcj_4_result=$? + if test "x$gcj_4_result" = "x0"; then + AC_MSG_RESULT([4.0 or higher found]) else - AC_MSG_WARN($GCJ_VERSION: gcj 3.3 or higher required) + AC_MSG_WARN([4.0 or higher required]) fi + AC_LANG_POP fi ]) |