xref: /aoo41x/main/solenv/inc/tg_compv.mk (revision 6d1ed1dd)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24COMPVERMK:=$(SOLARINCDIR)/comp_ver.mk
25
26.INCLUDE .IGNORE : $(COMPVERMK)
27
28.IF "$(COMNAME)"=="" || "$(COMPATH:s!\!/!)"!="$(COMPATH_STORED)"
29.IF "$(L10N_framework)"==""
30
31COMNAME:=
32
33.IF "$(COM)"=="GCC"
34CFLAGSVERSION=-dumpversion
35CFLAGSVERSION_CMD=-dumpversion
36CFLAGSNUMVERSION_CMD=-dumpversion $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
37#CFLAGSNUMVERSION_CMD=-dumpversion | 2>&1  $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
38.ENDIF
39
40.IF "$(COM)"=="MSC"
41CFLAGSVERSION=
42CFLAGSVERSION_CMD=  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
43CFLAGSNUMVERSION_CMD=  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
44.ENDIF
45
46.IF "$(COM)"=="C55" || "$(COM)"=="C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
47CFLAGSVERSION= -V
48CFLAGSVERSION_CMD= -V  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
49CFLAGSNUMVERSION_CMD= -V  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
50.ENDIF
51
52.IF "$(COM)"=="C730"
53CFLAGSVERSION= -version
54CFLAGSVERSION_CMD= -version |& cut -d" " -f4-
55CFLAGSNUMVERSION_CMD= -version |& cut -d" " -f4-
56.ENDIF
57
58# that's the version known by the specific
59# compiler
60CCVER:=$(shell @-$(CXX) $(CFLAGSVERSION_CMD))
61
62# and a computed integer for comparing
63# each point seperated token blown up to 4 digits
64CCNUMVER:=$(shell @-$(CXX) $(CFLAGSNUMVERSION_CMD))
65
66.IF "$(COM)"=="MSC"
67.IF "$(CCNUMVER)">="001200000000"
68COMID=MSC
69COMNAME=msci
70.ENDIF
71.ENDIF
72
73.IF "$(COM)"=="GCC"
74
75SHORTSTDCPP3:=
76SHORTSTDC3:="1"
77
78.IF "$(CCNUMVER)">="000200910000"
79COMID=GCC
80COMNAME=gcc2
81.ENDIF
82
83.IF "$(CCNUMVER)">="000300000001"
84
85COMID=gcc3
86COMNAME=gcc3
87
88.IF "$(CCNUMVER)">="000300000001"
89SHORTSTDCPP3="3"
90.ENDIF
91
92.IF "$(CCNUMVER)">="000300010000"
93SHORTSTDCPP3="4"
94.ENDIF
95
96.IF "$(CCNUMVER)">="000300020000"
97SHORTSTDCPP3="5"
98.ENDIF
99
100.IF "$(CCNUMVER)">="000300040000"
101.IF "$(OS)$(CPU)" == "LINUX6" || "$(OS)$(CPU)" == "LINUXH"
102#for gcc >= 3.4.0 on m68k-linux this is libgcc_s.so.2.
103#for gcc >= 3.4.0 < 4.2.0 on hppa-linux this is libgcc_s.so.2.
104SHORTSTDC3:="2"
105.ENDIF
106SHORTSTDCPP3="6"
107.ENDIF
108
109.IF "$(CCNUMVER)">="000400020000"
110.IF "$(OS)$(CPU)" == "LINUXH"
111#for gcc >= 4.2.0 on hppa-linux this is libgcc_s.so.4.
112SHORTSTDC3:="4"
113.ENDIF
114SHORTSTDCPP3="6"
115.ENDIF
116
117.ENDIF
118.ENDIF
119
120.IF "$(COM)"=="C55" || "$(COM)" == "C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
121.IF "$(CCNUMVER)">="00050002"
122COMID=C52
123COMNAME=sunpro5
124.ENDIF
125.ENDIF
126
127.IF "$(COM)"=="C730"
128COMID=C730
129COMNAME=MipsPro
130.ENDIF
131
132.IF "$(COM)"=="CLANG"
133COMID=s5abi
134COMNAME=s5abi
135.ENDIF
136
137.IF "$(COMNAME)"==""
138
139# "EXCEPTIONSFILES" get compiled before this, but shouldn't
140# appear in the first n modules.
141
142compiler_version_error:
143    @echo ++++++++++++++++++++++++++++++++++++
144    @echo  ERROR!
145    @echo  Could not detect compiler version!
146    @echo  Please extend tg_compv.mk in
147    @echo  "solenv/inc".
148    @echo ++++++++++++++++++++++++++++++++++++
149	@echo "$(CXX) $(CFLAGSVERSION)" returns
150	@$(CXX) $(CFLAGSVERSION)
151    @echo ++++++++++++++++++++++++++++++++++++
152	force_dmake_to_error
153
154.ENDIF          # "$(COMNAME)"==""
155
156CDEFS+=-DCPPU_ENV=$(COMNAME)
157
158.ENDIF			# "$(L10N_framework)"==""
159.ENDIF			# "$(COMNAME)"==""
160