summaryrefslogtreecommitdiffstats
path: root/editors/openoffice.org-1.0/files/patch-solenv::bin::getcompver.awk
blob: 62786af61ad5eba3d074bf1ba81c53e33f8ec0f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- ../solenv/bin/getcompver.awk.orig	Tue May 28 13:09:01 2002
+++ ../solenv/bin/getcompver.awk	Tue May 28 13:08:14 2002
@@ -61,9 +61,11 @@
 #*************************************************************************
 BEGIN {
     CCversion = 0
+    compiler_matched = 0
 }
 # Sun c++ compiler
 /Sun WorkShop/ {
+    compiler_matched = 1
     # version number right after "C++" 
     x = match( $0, /C\+\+ .*/ )
     btwn = substr( $0, RSTART, RLENGTH)
@@ -73,12 +75,28 @@
 }
 # Microsoft c++ compiler
 /Microsoft.*..\...\...../ {
+    compiler_matched = 1
     # match on the format of the ms versions ( dd.dd.dddd )
     x = match( $0, /..\...\...../ )
     CCversion = substr( $0, RSTART, RLENGTH)
 }
+# Java
+/java version/ {
+    compiler_matched = 1
+    # match on the format of the java versions ( d[d].d[d].d[d] )
+    x = match( $0, /".*\..*\..*"/ )
+    CCversion = substr( $0, RSTART+1, RLENGTH-2)
+}
+/^[0-9]*[.][0-9]*$/ {
+    if ( compiler_matched == 0 ) {
+# need to blow to x.xx.xx for comparing
+    	CCversion = $0 ".0"
+    }
+}
 /^[0-9]*[.][0-9]*[.][0-9]*$/ {
-    CCversion = $0
+    if ( compiler_matched == 0 ) {
+        CCversion = $0
+    }
 }
 END {
     if ( num == "true" ) {
OpenPOWER on IntegriCloud