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