xref: /aoo41x/main/solenv/inc/tg_compv.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
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.
14#
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).
20#
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.
25#
26#*************************************************************************
27
28COMPVERMK:=$(SOLARINCDIR)/comp_ver.mk
29
30.INCLUDE .IGNORE : $(COMPVERMK)
31
32.IF "$(COMNAME)"=="" || "$(COMPATH:s!\!/!)"!="$(COMPATH_STORED)"
33.IF "$(L10N_framework)"==""
34
35COMNAME:=
36
37.IF "$(COM)"=="GCC"
38CFLAGSVERSION=-dumpversion
39CFLAGSVERSION_CMD=-dumpversion
40CFLAGSNUMVERSION_CMD=-dumpversion $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
41#CFLAGSNUMVERSION_CMD=-dumpversion | 2>&1  $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
42.ENDIF
43
44.IF "$(COM)"=="MSC"
45CFLAGSVERSION=
46CFLAGSVERSION_CMD=  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
47CFLAGSNUMVERSION_CMD=  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
48.ENDIF
49
50.IF "$(COM)"=="C55" || "$(COM)"=="C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
51CFLAGSVERSION= -V
52CFLAGSVERSION_CMD= -V  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
53CFLAGSNUMVERSION_CMD= -V  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
54.ENDIF
55
56.IF "$(COM)"=="C730"
57CFLAGSVERSION= -version
58CFLAGSVERSION_CMD= -version |& cut -d" " -f4-
59CFLAGSNUMVERSION_CMD= -version |& cut -d" " -f4-
60.ENDIF
61
62# that's the version known by the specific
63# compiler
64CCVER:=$(shell @-$(CXX) $(CFLAGSVERSION_CMD))
65
66# and a computed integer for comparing
67# each point seperated token blown up to 4 digits
68CCNUMVER:=$(shell @-$(CXX) $(CFLAGSNUMVERSION_CMD))
69
70.IF "$(COM)"=="MSC"
71.IF "$(CCNUMVER)">="001200000000"
72COMID=MSC
73COMNAME=msci
74.ENDIF
75.ENDIF
76
77.IF "$(COM)"=="GCC"
78
79SHORTSTDCPP3:=
80SHORTSTDC3:="1"
81
82.IF "$(CCNUMVER)">="000200910000"
83COMID=GCC
84COMNAME=gcc2
85.ENDIF
86
87.IF "$(CCNUMVER)">="000300000001"
88
89COMID=gcc3
90COMNAME=gcc3
91
92.IF "$(CCNUMVER)">="000300000001"
93SHORTSTDCPP3="3"
94.ENDIF
95
96.IF "$(CCNUMVER)">="000300010000"
97SHORTSTDCPP3="4"
98.ENDIF
99
100.IF "$(CCNUMVER)">="000300020000"
101SHORTSTDCPP3="5"
102.ENDIF
103
104.IF "$(CCNUMVER)">="000300040000"
105.IF "$(OS)$(CPU)" == "LINUX6" || "$(OS)$(CPU)" == "LINUXH"
106#for gcc >= 3.4.0 on m68k-linux this is libgcc_s.so.2.
107#for gcc >= 3.4.0 < 4.2.0 on hppa-linux this is libgcc_s.so.2.
108SHORTSTDC3:="2"
109.ENDIF
110SHORTSTDCPP3="6"
111.ENDIF
112
113.IF "$(CCNUMVER)">="000400020000"
114.IF "$(OS)$(CPU)" == "LINUXH"
115#for gcc >= 4.2.0 on hppa-linux this is libgcc_s.so.4.
116SHORTSTDC3:="4"
117.ENDIF
118SHORTSTDCPP3="6"
119.ENDIF
120
121.ENDIF
122.ENDIF
123
124.IF "$(COM)"=="C55" || "$(COM)" == "C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
125.IF "$(CCNUMVER)">="00050002"
126COMID=C52
127COMNAME=sunpro5
128.ENDIF
129.ENDIF
130
131.IF "$(COM)"=="C730"
132COMID=C730
133COMNAME=MipsPro
134.ENDIF
135
136.IF "$(COMNAME)"==""
137
138# "EXCEPTIONSFILES" get compiled before this, but shouldn't
139# appear in the first n modules.
140
141compiler_version_error:
142    @echo ++++++++++++++++++++++++++++++++++++
143    @echo  ERROR!
144    @echo  Could not detect compiler version!
145    @echo  Please extend tg_compv.mk in
146    @echo  "solenv/inc".
147    @echo ++++++++++++++++++++++++++++++++++++
148	@echo "$(CXX) $(CFLAGSVERSION)" returns
149	@$(CXX) $(CFLAGSVERSION)
150    @echo ++++++++++++++++++++++++++++++++++++
151	force_dmake_to_error
152
153.ENDIF          # "$(COMNAME)"==""
154
155CDEFS+=-DCPPU_ENV=$(COMNAME)
156
157.ENDIF			# "$(L10N_framework)"==""
158.ENDIF			# "$(COMNAME)"==""
159