Bump for 3.6-28
[LibreOffice.git] / solenv / bin / getcompver.awk
blob124e915b72c9ae5770cd31323e4f0ba028b51262
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
27 BEGIN {
28 CCversion = 0
29 compiler_matched = 0
31 # Sun c++ compiler
32 /Sun WorkShop/ || /Forte Developer/ || /Sun/{
33 compiler_matched = 1
34 # version number right after "C++"
35 x = match( $0, /C\+\+ .*/ )
36 btwn = substr( $0, RSTART, RLENGTH)
37 # extract version, whitespaces get striped later
38 x = match( btwn, / .*\..*[ $\t]/)
39 CCversion = substr( btwn, RSTART, RLENGTH)
41 # Microsoft c++ compiler
42 /Microsoft/ && /..\...\...../ {
43 compiler_matched = 1
44 # match on the format of the ms versions ( dd.dd.dddd )
45 x = match( $0, /..\...\...../ )
46 CCversion = substr( $0, RSTART, RLENGTH)
48 # Java
49 /java version/ || /openjdk version/ {
50 compiler_matched = 1
51 # match on the format of the java versions ( d[d].d[d].d[d] )
52 x = match( $0, /[0-9]*\.[0-9]*\.[0-9]*/ )
53 CCversion = substr( $0, RSTART, RLENGTH)
55 /^[0-9]*[.][0-9]*\r*$/ {
56 if ( compiler_matched == 0 ) {
57 # need to blow to x.xx.xx for comparing
58 CCversion = $0 ".0"
61 /^[0-9]*[.][0-9]*[.][0-9]*\r*$/ {
62 if ( compiler_matched == 0 ) {
63 CCversion = $0
66 /^[0-9]*[.][0-9]*[.][0-9]*-[0-9a-z]*$/ {
67 if ( compiler_matched == 0 ) {
68 CCversion = substr($0, 0, index($0, "-") - 1)
71 END {
72 if ( num == "true" ) {
73 tokencount = split (CCversion,vertoken,".")
74 for ( i = 1 ; i <= tokencount ; i++ ) {
75 printf ("%04d",vertoken[i] )
77 } else
78 print CCversion