xref: /aoo41x/main/solenv/inc/tg_compv.mk (revision 23455dab)
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.ELIF "$(COM)"=="CLANG"
39CFLAGSVERSION=--version
40CFLAGSVERSION_CMD=--version | head -n1 | sed -e"s/.*version //" -e"s/ .*//"
41CFLAGSNUMVERSION_CMD=${CFLAGSVERSION_CMD} | sed -e"s/\.//"
42.ELIF "$(COM)"=="MSC"
43CFLAGSVERSION=
44CFLAGSVERSION_CMD=  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
45CFLAGSNUMVERSION_CMD=  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
46.ENDIF
47
48.IF "$(COM)"=="C55" || "$(COM)"=="C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
49CFLAGSVERSION= -V
50CFLAGSVERSION_CMD= -V  $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
51CFLAGSNUMVERSION_CMD= -V  $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
52.ENDIF
53
54.IF "$(COM)"=="C730"
55CFLAGSVERSION= -version
56CFLAGSVERSION_CMD= -version |& cut -d" " -f4-
57CFLAGSNUMVERSION_CMD= -version |& cut -d" " -f4-
58.ENDIF
59
60# that's the version known by the specific
61# compiler
62CCVER:=$(shell @-$(CXX) $(CFLAGSVERSION_CMD))
63
64# and a computed integer for comparing
65# each point seperated token blown up to 4 digits
66CCNUMVER:=$(shell @-$(CXX) $(CFLAGSNUMVERSION_CMD))
67
68.IF "$(COM)"=="MSC"
69.IF "$(CCNUMVER)">="001200000000"
70COMID=MSC
71COMNAME=msci
72.ENDIF
73.ENDIF
74
75.IF "$(COM)"=="GCC"
76
77SHORTSTDCPP3:=
78SHORTSTDC3:="1"
79
80.IF "$(CCNUMVER)">="000200910000"
81COMID=GCC
82COMNAME=gcc2
83.ENDIF
84
85.IF "$(CCNUMVER)">="000300000001"
86
87COMID=gcc3
88COMNAME=gcc3
89
90.IF "$(CCNUMVER)">="000300000001"
91SHORTSTDCPP3="3"
92.ENDIF
93
94.IF "$(CCNUMVER)">="000300010000"
95SHORTSTDCPP3="4"
96.ENDIF
97
98.IF "$(CCNUMVER)">="000300020000"
99SHORTSTDCPP3="5"
100.ENDIF
101
102.IF "$(CCNUMVER)">="000300040000"
103.IF "$(OS)$(CPU)" == "LINUX6" || "$(OS)$(CPU)" == "LINUXH"
104#for gcc >= 3.4.0 on m68k-linux this is libgcc_s.so.2.
105#for gcc >= 3.4.0 < 4.2.0 on hppa-linux this is libgcc_s.so.2.
106SHORTSTDC3:="2"
107.ENDIF
108SHORTSTDCPP3="6"
109.ENDIF
110
111.IF "$(CCNUMVER)">="000400020000"
112.IF "$(OS)$(CPU)" == "LINUXH"
113#for gcc >= 4.2.0 on hppa-linux this is libgcc_s.so.4.
114SHORTSTDC3:="4"
115.ENDIF
116SHORTSTDCPP3="6"
117.ENDIF
118
119.ENDIF
120.ENDIF
121
122.IF "$(COM)"=="C55" || "$(COM)" == "C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
123.IF "$(CCNUMVER)">="00050002"
124COMID=C52
125COMNAME=sunpro5
126.ENDIF
127.ENDIF
128
129.IF "$(COM)"=="C730"
130COMID=C730
131COMNAME=MipsPro
132.ENDIF
133
134.IF "$(COM)"=="CLANG"
135.IF "$(OS)" == "FREEBSD"
136COMID=gcc3
137COMNAME=gcc3
138.ELSE
139COMID=s5abi
140COMNAME=s5abi
141.ENDIF
142.ENDIF
143
144.IF "$(COMNAME)"==""
145
146# "EXCEPTIONSFILES" get compiled before this, but shouldn't
147# appear in the first n modules.
148
149compiler_version_error:
150    @echo ++++++++++++++++++++++++++++++++++++
151    @echo  ERROR!
152    @echo  Could not detect compiler version!
153    @echo  Please extend tg_compv.mk in
154    @echo  "solenv/inc".
155    @echo ++++++++++++++++++++++++++++++++++++
156	@echo "$(CXX) $(CFLAGSVERSION)" returns
157	@$(CXX) $(CFLAGSVERSION)
158    @echo ++++++++++++++++++++++++++++++++++++
159	force_dmake_to_error
160
161.ENDIF          # "$(COMNAME)"==""
162
163CDEFS+=-DCPPU_ENV=$(COMNAME)
164
165.ENDIF			# "$(L10N_framework)"==""
166.ENDIF			# "$(COMNAME)"==""
167