2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 /Sun WorkShop
/ || /Forte Developer
/ || /Sun
/{
25 # version number right after "C++"
26 x =
match( $
0, /C\
+\
+ .
*/ )
27 btwn =
substr( $
0, RSTART, RLENGTH)
28 # extract version, whitespaces get striped later
29 x =
match( btwn
, / .
*\..
*[ $
\t]/)
30 CCversion =
substr( btwn
, RSTART, RLENGTH)
32 # Microsoft c++ compiler
33 /Microsoft
/ && /..\...\.....
/ {
35 # match on the format of the ms versions ( dd.dd.dddd )
36 x =
match( $
0, /..\...\.....
/ )
37 CCversion =
substr( $
0, RSTART, RLENGTH)
40 /java version
/ || /openjdk version
/ {
42 # match on the format of the java versions ( d[d].d[d].d[d] )
43 if (match($
0, /[0-9]+\.
[0-9]+\.
[0-9]+/)) {
44 CCversion =
substr($
0, RSTART, RLENGTH)
45 } else if (match($
0, /[0-9]+\.
[0-9]+/)) {
46 CCversion =
substr($
0, RSTART, RLENGTH) "."
47 } else if (match($
0, /[0-9]+/)) {
48 CCversion =
substr($
0, RSTART, RLENGTH) ".."
51 /^
[0-9]*[.
][0-9]*\r*$
/ {
52 if ( compiler_matched ==
0 ) {
53 # need to blow to x.xx.xx for comparing
57 /^
[0-9]*[.
][0-9]*[.
][0-9]*\r*$
/ {
58 if ( compiler_matched ==
0 ) {
62 /^
[0-9]*[.
][0-9]*[.
][0-9]*-[0-9a
-z
]*$
/ {
63 if ( compiler_matched ==
0 ) {
64 CCversion =
substr($
0, 0, index($
0, "-") - 1)
67 # NDK r8b has "4.6.x-google"
68 /^
[0-9]*[.
][0-9]*[.
][a
-z
]*-[0-9a
-z
]*$
/ {
69 if ( compiler_matched ==
0 ) {
70 # Include the second period in the match so that
71 # we will get a micro version of zero
72 x =
match( $
0, /^
[0-9]*[.
][0-9]*[.
]/ )
73 CCversion =
substr($
0, RSTART, RLENGTH)
77 if ( num ==
"true" ) {
78 tokencount =
split (CCversion
,vertoken
,".")
79 for ( i =
1 ; i
<= tokencount
; i
++ ) {
80 printf ("%04d",vertoken
[i
] )