commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcj-version-check-1.patch


From: Steven Augart
Subject: gcj-version-check-1.patch
Date: Fri, 21 May 2004 23:28:20 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421

I want to thank Michael Koch for telling me where I needed to look in order to fix this bug. I've always felt intimidated by the "acinclude" command.
--
Steven Augart

Jikes RVM, a free, open source, Virtual Machine:
http://oss.software.ibm.com/jikesrvm
This change fixes the CLASSPATH_CHECK_GCJ macro that our autoconf files
use.  

We now correctly print a warning message during autoconfiguration, if
given (for example) version 3.2.2 when we actually need at least
version 3.3.  We used to get confused with the messages emitted by GCJ
3.2, and possibly earlier 3.x versions.

Please commit it with the following ChangeLog entry:
2004-05-21  Steven Augart  <address@hidden>

        * acinclude.m4
        (CLASSPATH_CHECK_GCJ):  Fixed the version number check to work
        with GCC 3's --version message.
        

Index: acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/acinclude.m4,v
retrieving revision 1.36
diff -I*.class -u -r1.36 acinclude.m4
--- acinclude.m4        17 May 2004 09:14:13 -0000      1.36
+++ acinclude.m4        22 May 2004 03:24:04 -0000
@@ -318,8 +318,30 @@
   fi  
 
   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)
-    GCJ_VERSION=`$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`
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]